I have done this before, but having troubles with the different seperators in this one. I basically have an autogenerated flat file that is an export of a directory structure. I want to parse through the flat file and pull values from specific lines that contain a file name with the extention of .dat. From that I want to collect the Date-Time, Size, and portion of the filename. And skip the rest.
.Example Flat File.
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
.End Flat File Example.
.Output Desired.
Record 1
Date-Time = 02/02/2008 11:35 AM
Size = 851,744
Name = 0801 (This is always 4 characters to left of the .)
Record 2
Date-Time = 02/09/2008 11:36 AM
Size = 299,216
Name = 0823 (This is always 4 characters to left of the .)
ect....
Thanks for any help on this.
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: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.