Thank you very much for the help guys. All my questions thus far have been answered and then some.

It completely works the way I want it to, but I am curious, what if some lines had, lets say a word in the beginning of the line. That I did not want to return with the rest of the line, for instance, I have one line with the word DISKUSED in the front.

The normal structure of the lines I am returning look like this:

DISKUSED OK - /vol/hello/ - total: 83886080 Kb - used 519800 Kb (1%) - + free: 83366280 Kb /vol/john/.snapshot - total: 0 Kb - used 30971856 Kb (0%) - free: 0 Kb /vol/bill/ - total: 20132660 Kb - used 7178128 Kb (36%) - free: 129545 +32 Kb /vol/ted/ - total: 52428800 Kb - used 4137924 Kb (8%) - free: 48290876 + Kb

There is only one instance where there will be something before the volume name in my file. I just want to be prepared for that, but at the same time I am curious as to how to get passed that if it occurred multiple times.

I guess what I am trying to ask is, as opposed to returning the entire line, how can I manipulate the STDOUT to be printing everything from $vol_to_parse to end of line?

And secondly, is that the right way I should be thinking for a situation like this in perl? Or is there some kind of reverse-chomp-type modifier.

Once again, any and all help is greatly appreciated.

Thank you,

Sluggo


In reply to Re^3: Parsing a file line by line until a certain indice in array by sluggo
in thread Parsing a file line by line until a certain indice in array by sluggo

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • 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:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.