[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Omaha.pm] More data code pointers.



Hello,

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 or convert
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?

--
Jay Swackhamer
Reboot The User
402-933-6449
http://www.reboottheuser.com
http://www.cafepress.com/rtu
http://stores.ebay.com/RebootTheUser
http://www.hotr.com