Quote:
Originally Posted by
KevinADC
Change the single-quotes that surround the code to double-quotes when running on Windows.
Hi,
This file "config.prop" is located in various directories which are mapped as
u:
v:
n:
with the below code provided (from one of perl experts), i did try the same and could change the file in only one location.
while(<>){
chomp;
if ( /windowsdrivestocrawl=/){
w:/fdm9_84919_c347_2
}
print $_ ."\n";
}
The above is working perfectly, but only for the file located in current directory. (i have put in $file="config.prop" and it works fine if this is in current directory, but how to code for the directories as it changes - where iam stuck up!!)
Now this code needs to change this file in 3 different locations, with the directory and subsititution that changes for each directory. I will place this file in C: and then run the script so that it changes in all these 3 different locations (u, v, and n)
Example:
dir1:u:\psem\techart\agent
changefrom:n:/fdm9_84919_c347|j:/fdm9_84919_c347|w:/fdm9_84919_c347_2
changeto:w:/fdm9_84919_c347_2
The above is done using the code provided.
dir2:v:\psem\techart\agent
changefrom: n:/fdm9_84919_c347|j:/fdm9_84919_c347|w:/fdm9_84919_c347_2
changeto:n:/fdm9_84919_c347
dir3:n:\psem\techart\agent
changefrom: n:/fdm9_84919_c347|j:/fdm9_84919_c347|w:/fdm9_84919_c347_2
changeto:j:/fdm9_84919_c347
I tried with a variable
$dir and assigning it to other locations specified above.
It does not work.
Can you let me know how to do it? Any directions?
With just one code, i need to change the file in three different locations.