#!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
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |