in reply to Bug in script when users use long names
I will offer a (very) general approach, or hint rather.
It appears that your data samples, especially sample 2, represents a form of fixed length records that consist of a header record that can be identified by have a non-space character in col 1 (assume 1-based col numbering) and continuation records identified by space characters in cols 1 and 2.
Given that you can easily find the start of a master record, and that there appears to be a standard structure to the continuation records, then unpack becomes your best friend and makes the actual extraction trivial.
The presence of the header title records is what reduces this to a simple problem that unpack is uniquely intended to handle. All that you really need to do is keep track of what record/sub-record row number you are on so you apply the correct unpack pattern to it and extract the data to normal variables.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Bug in script when users use long names
by Sparky (Initiate) on Sep 25, 2013 at 00:42 UTC | |
by boftx (Deacon) on Sep 25, 2013 at 04:47 UTC | |
by soonix (Canon) on Sep 25, 2013 at 09:42 UTC | |
by Anonymous Monk on Sep 25, 2013 at 01:23 UTC |