The split_fixed command splits a field into sub fields based on fixed positions.
See also: split_char, read_fixed
Flag |
Req'd? |
Description |
-f field |
Yes |
Index of the field that you want to split. The first field in a row has index 1. |
-p poslist |
Yes |
Specifies a list of positions at which the field should be split. Each position consists of a start and a length separated by a colon. For example: |
-k |
No |
Indicates if the field being split is retained in the output. By default it is removed. |
The following example splits the first field of the emp.csv file into numeric employee number and sex indicator:
csvfix split_fixed -f 1 -p 1:4,5:1 data/emp.csv
producing:
"1090","M","Jeff Smith"
"1099","F","Annette King"
"1170","M","Bill Thompson"
"1101","M","Jeremy Fisher"
"1088","F","Lynn Morrice"
Created with the Personal Edition of HelpNDoc: Free HTML Help documentation generator