Computing.Net > Forums > Programming > Batch file in perl

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Batch file in perl

Reply to Message Icon

Name: mike999
Date: December 22, 2005 at 14:07:37 Pacific
OS: WINDOWS2000
CPU/Ram: 2.5ghz
Comment:

I need a batch program in perl to process some files.[ I run perl in Dos prompt( ActivePerl for windows is installed ]

I have a list of file names in a txt file called "list.txt" This txt file contains 100 file names ex: 200210_1_1001
200210_1_1002
200210_1_1003...so on till 100.

I have a perl program called "info.pl"

My command line for processing single file is like
" info 200210_1_1002 system date user"

I want this to be processed for all 100 files by a batch file in perl.

I would appreciate if anyone would guide me.

thanks in advance :-)


little scorpion



Sponsored Link
Ads by Google

Response Number 1
Name: FishMonger
Date: December 22, 2005 at 15:28:18 Pacific
Reply:

It would be more efficient to modify your current script to readin and loop through your list.txt file.

I assume you mean "system date" to be today's date formated in some manor. Since you're not real clear on what this is, I'll leave it as you posted.

Here's a command line version.
perl -ne "chomp; system(\"info.pl $_ system date user\");" list.txt


Here's a script version.
#!perl -w

open(LIST, 'list.txt') || die "can't open list.txt $!";

while (<LIST>) {
chomp;
system("info.pl $_ system date user");
}
close LIST;


0
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: Batch file in perl

Batch program in Perl needed www.computing.net/answers/programming/batch-program-in-perl-needed/13724.html

help me i want hidden batch file in running www.computing.net/answers/programming/help-me-i-want-hidden-batch-file-in-running/19793.html

Excel VBA - batch file in Dos - She www.computing.net/answers/programming/excel-vba-batch-file-in-dos-she/3568.html