https://github.com/mrzmyr/sps-parser
Parse your SPS file and modify and save it to make working with tools like soscisurvey.de more flexible
https://github.com/mrzmyr/sps-parser
parser soscisurvey sps spss
Last synced: 11 months ago
JSON representation
Parse your SPS file and modify and save it to make working with tools like soscisurvey.de more flexible
- Host: GitHub
- URL: https://github.com/mrzmyr/sps-parser
- Owner: mrzmyr
- License: mit
- Created: 2017-12-14T09:00:39.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2017-12-14T15:04:25.000Z (over 8 years ago)
- Last Synced: 2025-03-15T02:14:21.592Z (over 1 year ago)
- Topics: parser, soscisurvey, sps, spss
- Language: JavaScript
- Homepage: https://github.com/mrzmyr/sps-parser#readme
- Size: 29.3 KB
- Stars: 2
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# SPS Parser
> Parse your SPS file and modify and save it to make working with tools like [soscisurvey.de](https://www.soscisurvey.de/) and SPSS more flexible
### Installation
Use the file in `lib/sps-parser.js`
> Haven't got the time to publish to `npm`
### Usage
#### Read & Write
```js
const Parser = require('./sps-parser')
const content = fs.readFileSync('your-file.sps', 'utf8')
let parser = new Parser(content)
// replace case with case id 188 value 'HE01_03' with '5'
parser.replace(188, 'HE01_03', 5)
// get raw text output with new values
let newContent = parser.getText()
fs.writeFileSync('./test.sps', newContent, 'utf8');
```
#### Get Values & Variables
```js
const Parser = require('./sps-parser')
const content = fs.readFileSync('your-file.sps', 'utf8')
let parser = new Parser(content)
let value = parser.getValue(188, 'HE01_03')
let values = parser.getValues()
let variables = parser.getVariables()
```