[EMAIL PROTECTED] wrote:
Greetings,
Hello,
Would someone be kind enough to point me in the right direction to solve this problem?
I'll try :)
An application creates XML files in a subdirectory, which I then convert to EDI. That part is now working fine. My problem is that the application creates files during the day, with slightly different names. For example:
File0001.xml File0002.xml File0244.xml
The file names vary based on what part of the application creates them. There seems to be no pattern of the number after the alpha characters. I need to read each of these files, and concatenate them into a single EDI file. The only files in the subdirectory need to be processed; and all of the files in the subdirectory need to be processed.
Could someone point me in the right direction?
Not sure about how the filename effects if you want to incude it or not but:
#!/usr/bin/perl
use strict; use warnings; use File::Slurp;
for(read_dir('/xml/files')) { if($_ =~ m/\.xml$/) { my $xml = read_file("/xml/files/$_"); append_file('/xml/together.edi',$xml); } }
Thanks for your help.
No problem :)
Lee.M - JupiterHost.Net
-- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>