in reply to Re: Re: Re: reading lines
in thread reading lines
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re: Re: Re: reading lines
by graff (Chancellor) on Dec 07, 2003 at 05:45 UTC | |
Ah, that changes things a bit. Is there a distinct and consistent string pattern that separates one ipconfig output from another, such as a blank line, or a line of dashes? If so, you can assign that string to "$/" (rather than leaving it with the default value of CRLF, or setting it to undef, as suggested by BrowserUK). This way, you read one whole ipconfig output set in a single iteration of while (<>). For example, if the successive records are separated by a single blank line (and blank lines never occur within a single ipconfig output record), then you could do like this (untested): (update: removed a spurious line of code) If the separation between ipconfig runs is not distinct or consistent, then you'll want to fall back on BrowserUK's less-favored method that reads one line at a time and uses a status flag to keep track of what it's supposed to look for (and what it's supposed to do) as it works through each multi-line record. | [reply] [d/l] [select] |
by spill (Novice) on Dec 07, 2003 at 18:13 UTC | |
It is clear that my data is more complicated than my first example. I thought it would be easier to understand what I needed to do, but it only introduced more confusion. ;) Thanks to everyone that has responded, if anything I have learned some other techniques for manipulating my data. | [reply] [d/l] |