Hi:

I have a directory in which I have about sixty files.  Of these say 30 have a
.ctl extension.  The 2nd or 3rd line in the files that have a .ctl extension
reads something like this in all files:

INFILE '/u/svadlama/eCAMPUS/df4.3_2/prototype1/data/buckets.dat'

the text after the word INFILE could be different.

I want to replace the text after the INFILE with '/u/svadlama/toysrus/
filename.dat

notice that the file I want to manipulate is the .ctl files but the replacement
I want tomake is the same filename as the .ctl file but with a .dat
extension

I have the following code (not working right now  (any help will be
appreciated--I need to do this quick:

#!c:\perl
$dirname="c:\toysrus\data_df1"
opendir(DIR, $dirname) or die "can't opendir $dirname: $!";
while (defined($file = readdir(DIR))) {

$file_2=$file;

$file_2=s/\. ...//;
    $_=s#\s* INFILE *#"INFILE /u/svadlama/toysrus/"."$file_2"."dat"#
}
closedir(DIR);



---
You are currently subscribed to perl-win32-users as: [archive@jab.org]
To unsubscribe, forward this message to
         [EMAIL PROTECTED]
For non-automated Mailing List support, send email to  
         [EMAIL PROTECTED]

Reply via email to