Looking For Script That Will Format Data File... [message #98010] |
Fri, 17 October 2003 12:57 |
Rizwan Qazi
Messages: 135 Registered: August 2002
|
Senior Member |
|
|
I have a file before.txt that is hand manipulated by a clerk in a specific manner. Once manipulated this file is then read by a software that assumes that the file has a certain format. Here are the sets of steps that the hand manipulations that the file needs to go through
SPECS FOR FILE CHANGES
Assumption: Line 1 = 5558689183 (all records)
Line 1 = 5558689183 (Account #)
Line 2 = Primary Name
LIne 3 = "blank"
Line 4 = Address or 'XBT'
· If 'XBT' in first 3 bytes
· Move line 4 to line 3
· Move line 5 to line 4
· Move line 6 to line 5
· Skip to line 9
· If 'XBT' not in first 3 bytes, go to line 5
Line 5 = Address or "blank"
· If blank, move line 6 to line 5 then skip to line 9
· If 'not' blank, skip to line 9
Line 6 = City/State/Zip information
Line 7 = "blank"
Line 8 = "blank"
Line 9 = contract #
· Add "011" to beginning of number
· Add "0001" to end of number
· Skip to next Line 1 or 5558689183 number (start manipulation of data again using same logic)
Line 10 = 99 (do not change)
Line 11 = Y (do not change)
All this data needs to be put in file after.dat
Thanks
|
|
|