converting File layout from pipe to fixed length based on control file
I have the source file which is pipe demilited and i need the data to be converted into fixed length which is defined in control file.
i am maintaining the control file as i have several source file to be converted to respective fixed length file.The control file specifies the field position for source and target. There can be some default field in target which dont need any transformation form source so, i mentioned as -1 with default value in control file Source file AA|TEST1|DATA1 BBB|TEST2|DATA2 CCCC|TEST3|DATA3 DDDDD|TEST4|DATA4 Control file sourcefield|target field position|default value 3|1:8| 1|9:12| -1|13:14|X 2|15-20| Target File ( i provided ~ to specify the empty space and ^ to specify the end of line with 20 byte) DATA1~~~AA~~X~TEST1~^ DATA2~~~BBB~X~TEST2~^ DATA3~~~CCCCX~TEST3~^ DATA4~~~DDDDX~TEST4~^ Can you provide pointers /script to perfom this kind of file layout conversion Thanks |
Quote:
|
All times are GMT -5. The time now is 09:46 PM. |