update:
#!usr/bin/perl -w use strict; use Data::Dump qw(pp); my %data; foreach (<DATA>) { next if (/^\s*$/); #skip blank lines my ($str, $date) = m/^#RD(.+)?#OE.+?(\d+)/; push @{$data{"$str"."txt"}},"OE#$date"; } print pp \%data; =Prints { "#,3004,,,,,N,MANS.20111011.2,txt" => ["OE#284110217106"], "#,3023,,,,,N,MANS.20111011.2,txt" => ["OE#284110161544", "OE#284110 +161544"], } =cut __DATA__ #RD#,3023,,,,,N,MANS.20111011.2,#OE#,CR,N,284110161544,,Y,MANS,2011101 +1064839000,20111011~1M9LQV49HM #RD#,3023,,,,,N,MANS.20111011.2,#OE#,CR,N,284110161544,,Y,MANS,2011101 +1064839000,20111011~1M9LQV49HM,20111011064925000,20111011~1M9LQV49Ho, +,,20111011064925000 #RD#,3004,,,,,N,MANS.20111011.2,#OE#,RT,N,284110217106,,Y,MANS,2011101 +1065244000,20111011~1J6Q7ETYXH,,20111011~1J6Q7ETYXH,NVMI,201110110652 +44000,2324,E

In reply to Re: Help for generating multiple file from singl e file and parsing it. by Marshall
in thread Help for generating multiple file from singl e file and parsing it. by sarf13

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.