splitit.pl -- Split Multi-column Variable Statements
This Perl script reads a file containing multi-column SAS Input or SPSS Data List statements and reformats them into a single-column format with one field per line. Handy for checking multi-column declarations when preparing your code.
- Output is sent to STDOUT. To save it, redirect STDOUT to a file.
- Output is one field per line.
- Developed for SAS/SPSS program prep. See also wrapit5.
- Show splitit.pl code
- Download: splitit.pl
Usage
The command line is: perl splitit.pl filename >filename.out
Here is an example. Consider this input data:
Sample input (cards): V1 1-4 V2 5-8 V3 9-9 V4 10-13 (A) V5 14-14 V6 15-16 V7 17-17 V8 18-19 V9 20-21 The command perl splitit.pl cards > cards.split produces this: Sample output (cards.split) V1 1-4 V2 5-8 V3 9-9 V4 10-13 (A) V5 14-14 V6 15-16 V7 17-17 V8 18-19 V9 20-21
Back to Kent's Perl Page