Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: how to identify a fixed width file

by Pancho (Pilgrim)
on May 14, 2008 at 12:46 UTC ( [id://686503]=note: print w/replies, xml ) Need Help??


in reply to how to identify a fixed width file


I think the key is figuring out the criteria by which you can test a file is fixed width and that depends on your requirements. If the criteria is too broad then the validity of the test will decrease to the point where the test is useless.

A different approach would be to look for a certain pattern in the record identifier and record length, again depending on your requirements for example:

First record starts with H and second with D third with T. The pattern repeats and all H records, D records and T records are the same length.

Good Luck

Pancho

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://686503]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others taking refuge in the Monastery: (2)
As of 2024-07-15 21:43 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    erzuuli‥ 🛈The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.