Using TextPad to extract and rewrite flatfiles
Posted: Thu Jun 09, 2011 4:21 pm
I am not sure this is something regex can do or another module within TextPad.
I have a flatfile which has multiple lines in it.
Each line represents a record.
For each record, data is written with xx-xx spaces, for example, first name might be 'contained' in spaces 127-145.
I can move to that 'space' using TextPad which allows me to validate the data.
Is there a way to write a regex expression, provided I know the 'space' values, to output a new file so data validation is more easily accomplished?
I do not have access to or ability to change the incoming flat file, I have to work with it as my source file.
Ideally, it would take data that looks like this
##41SmithMarc123Main Street AnytownST12345
to
ID ##41
LN Smith
FN Marc
AD1 123 Main Street
AD2
CI Anytown
ST ST
ZP 12345
I have to capture and extract data defined just by the location of the string (col 127) and the string length (127-145)
Is this possible?
Thanks in advance for the help.
= Marc
I have a flatfile which has multiple lines in it.
Each line represents a record.
For each record, data is written with xx-xx spaces, for example, first name might be 'contained' in spaces 127-145.
I can move to that 'space' using TextPad which allows me to validate the data.
Is there a way to write a regex expression, provided I know the 'space' values, to output a new file so data validation is more easily accomplished?
I do not have access to or ability to change the incoming flat file, I have to work with it as my source file.
Ideally, it would take data that looks like this
##41SmithMarc123Main Street AnytownST12345
to
ID ##41
LN Smith
FN Marc
AD1 123 Main Street
AD2
CI Anytown
ST ST
ZP 12345
I have to capture and extract data defined just by the location of the string (col 127) and the string length (127-145)
Is this possible?
Thanks in advance for the help.
= Marc