It's hard to see where your problem lies, my crystal ball is on the blink currently, but for this sort of job generally a combination of split and regular expressions does the trick.

Note that for posting code snippets we like to see self contained examples so a framework for your snippet would look like:

use strict; use warnings; my $fileData = <<FILEDATA; Volume in drive E is NEW Data Volume Serial Number is 901D-960F Directory of E:\My_DATA\LooK_Here\Year_2008\02_21_08 02/20/2008 12:52 PM <DIR> . 02/20/2008 12:52 PM <DIR> .. 02/02/2008 11:35 AM 851,744 01ID0801.dat 02/05/2008 11:35 AM 61 01ID0801.sta 02/09/2008 11:36 AM 299,216 01ID0823.dat 02/09/2008 11:36 AM 61 01ID0823.sta 02/10/2008 11:36 AM 373,018 01ID0827.dat 02/10/2008 11:36 AM 61 01ID0827.sta 02/11/2008 11:37 AM 49,258 01ID0855.dat 02/11/2008 11:37 AM 61 01ID0855.sta 02/15/2008 11:37 AM 427,803 01ID0861.dat 02/15/2008 11:37 AM 61 01ID0861.sta 02/18/2008 11:37 AM 282,035 01ID0865.dat 02/18/2008 11:38 AM 61 01ID0865.sta 1604 File(s) 386,639,292 bytes 2 Dir(s) 78,292,127,744 bytes free FILEDATA open my $inFile, '<', \$fileData; while (<$inFile>) { ... } close $inFile;

Perl is environmentally friendly - it saves trees

In reply to Re: Parsing Values from a Flat File? by GrandFather
in thread Parsing Values from a Flat File? by batcater98

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.