[Omaha.pm] More data code pointers.
Jay at RebootTheUser.com
Thu Feb 18 08:18:50 PST 2010
I've been trying different ways to read files that have been outputted
by a cobol program to process with perl to replace this 'syncsort'
program that is expensive.
If anyone has any insight/pointers to get this done, please share.
The file contains a variable line-length,
I get out of the paramter/config file for syncosort the fieldstart/end
for the ones that we care about.
The lines also can contain packed data.
So what I need some insight on, is the correct way to
1. read in a line, where you dont know the length.
2. Pull specific fields out of the line that may need to be unpacked
3. add the fields and put them back into the line, packed
4. write the line back to the file.
I have the routines written to do all of this if it were an actual
flat file, I've tried using binary mode, and using substr/etc, I just
need some insight on doing this with the packed data, where I dont
know the line length, or the rest of the field definitions.
Do I need to calculate the rest of the fields and use unpack, or is
there another way?
Reboot The User
More information about the Omaha-pm