Thanks for the tip on going with unpack.
The files that I have to use are text captures of account information screens at work (with personally identifiable info changed of course), so I can't post an example here, but here's a bit of a mockup...
LastName, FirstName Home <hm phone> field <value>
Address1 Work <wk phone> field <value>
Address2 field <value>
City, State, zip field <value> field <value>
field <value> field <value> field <value>
field <value> field <value> field <value>
field <value> field <value> field <value>
...etc...
So the bottom portion of the screen is kind of columnur, except for the fact that in some of the colums there are more than one field-value pair. There is no separator char between the fieldname and the value, and the amount of whitespace between a field and the value varies. (all whitespace is \040).
Each file will have the data for one record in the db. Some of the fieldnames have spaces in them, so I can't really think of a way to split the file into field-value pairs off of the top of my head.
Also, I'm liking unpack because of the top part of the screen, which has the name, address, etc. without any fieldname (which I forgot to mention in my original post).
Feeling like I'm making progress.
Thanks.
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.