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

Re: Survey file parsing

by jds17 (Pilgrim)
on Jun 27, 2008 at 17:58 UTC ( #694407=note: print w/replies, xml ) Need Help??

in reply to Survey file parsing

In case no header line starts with whitespace followed by "<", but the first non-header line does, a simple solution would be as follows. (Maybe I misunderstood your notation, and the lines do not really start that way, but then either the must be identifiable using another regex or you must resort to counting lines.)
my $in_header++; while (<IN>) { if ($in_header && !/^\s+</) { push(@hdr, $_); } else { $in_header = 0; #process non-header lines (if needed) #... } }

Replies are listed 'Best First'.
Re^2: Survey file parsing
by YYCseismic (Beadle) on Jun 27, 2008 at 22:02 UTC

    For the SEG-P1 format specification, all non-header lines (read: data lines) start with a space. That zero-offset position is reserved for identifying header lines.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://694407]
[ww]: or a lot more than (22*2) for /me
[ww]: er -- senior cognitive deficiency: ((22+(22*2))
[ww]: (but pls don't s/senior/senile/ ... not yet
[karlgoethebier]: A bit more audience now: The Impact of Information Sources on Code Security Very interesting IMHO...
[karlgoethebier]:'s about copy & paste ;-)

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (9)
As of 2017-09-25 14:39 GMT
Find Nodes?
    Voting Booth?
    During the recent solar eclipse, I:

    Results (280 votes). Check out past polls.