Jun 23, 2009, 12:01 PM
Post #1 of 2
Hi - I am an intermediate / expert perl user and am about to write a program that fulfills the requirements below. However, before I start - I wanted to poll the perl experts out there to see if you know of an existing program or module that does this already. I've already spent a half day looking around to no avail. I want to create a file layout for a delimited file.
Max Field Lengths for Delimited File
Take a delimited file (comma for simplicity) and output a result page that lists the field name and the maximum field length. There are variable number of fields (columns). There will be nothing in the csv changed or altered. The process should only analyze and output a newly created "file layout" that a client can use to create an optimally sized database or give correct information if they wanted to convert it to a fixed field file.
The program must run on *nix and we are talking 100 million record files and up.
File Example 1:
Expected Output 1:
File Example 2:
Expected Output 2:
It's pretty simple and I was hoping I wasn't the only person who needed such functionality. I'm tired of reinventing the wheel - so if anyone out there knows of a program they use or a module - I would appreciate it.