Re: manipulating data files
Posted in 2000
triggerfish
just substring the original string as you read the input file line by line, then
use join () with the | delimiter to stitch them together.
HTH
Sujit
triggerfish2001@hotmail.com on 10/18/2000 03:23:20 PM
Please respond to triggerfish2001@hotmail.com
To: informix-list@iiug.org
cc:
Subject: manipulating data files
Hi,
I have just basic knowledge of perl. The task I need to accomplish is as
follows:
source file needs to be converted to target file.
source file will be a fixed column length ASCII file of data.
target file will be a PIPE ('|') seperated ASCII file of data.
For eg:-
source file will be as follows:
John Smith 745-678-089011-10-1955
Robert IhaveAlongName345-567-453219-04-1967
Here the first 22 char is fixed length for name
Starting from 23rd char next 12 char is for SSN
Starting from 35th char next 10 char is for DOB.
Now this needs to be changed to
John Smith|745-678-0890|11-10-1955|
Robert IhaveAlongName|345-567-4532|19-04-1967|
The reason for this is that informix dbload or high performance loader needs
a field delimiter.
How can this be achieved in perl.
thanks.