Skip to main content

## split_regex

The split_regex command splits a field into sub fields based on regular expressions. You specify a number of remembered expressions using the \( .... \) regular expression syntax. These are matched against the specified input field and the matches are then recalled to form the split output.

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.
-r regex | Yes | Specifies the regular expression that will be used to perform the split.
-ic | No | Specifies that the regular expression should ignore alphabetic case differences.
-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 idname.csv file into a numeric id, followed by the remainder of the field (the name, in this case):

csvfix.exe split_r -f 1 -r '\([0-9]*\)\(.*\)' idname.csv

producing:

"1234","fred","m"

"22","bill","m"

"171171","lynn","f"

Created with the Personal Edition of HelpNDoc: Easy CHM and documentation editor

####