Hi All,
I have used this forum many times to solve my many scripting problems. This time, I would like to seek some answers to a problem that I've been head scratching quite a bit on.
My Example:
I am converting a 2000-byte file into a 300-byte file
this file has no delimiters and hardly any spaces inbetween the cols...
I have successfully converted most of the 2000-byte cols into the 300-byte file format by using awk's substr function, but I am having an issue in getting 1 col of the 2000-byte file to space properly in the 300-byte file.
SUBSTR would work perfectly if the data was positioned all the same way.
My dilema,
The 2000-byte column starts at position 150 and ends at 180 (30 bytes)
this col contains city,state,zip code info
and the positioning of these items varies per record...
example record#1 anytown us 11111
example record#2 any town us 11111
example record#3 anytown us11111
etc,
The requirements,
I have to specifically place the city info into position 159-181 of the 300-byte file
I have to specifically place the state info into pos 182-183
& I have to spcifically place the zip info into pos 184-188
Not sure what would work best, since I have to keep intact the integrity of each record as well.....and then manipulate this col .... without trashing anything else....I would appreciate any ideas...
thanks...