Feb 20, 2002 #1 qwert231 Programmer Sep 4, 2001 756 US You guys are gonna kill me. Now that I got my script searching for something simple, I want to search for this: <$@App.ShareDirectory>\Images\Shirley And replace it with: \\Dell2400\IMAGES\Brian\217531\000001\001.jpg
You guys are gonna kill me. Now that I got my script searching for something simple, I want to search for this: <$@App.ShareDirectory>\Images\Shirley And replace it with: \\Dell2400\IMAGES\Brian\217531\000001\001.jpg
Feb 20, 2002 #3 Coderifous Programmer Dec 13, 2001 782 US $this = "<$@App.ShareDirectory>\Images\Shirley\"; $that = "\\Dell2400\IMAGES\Brian\217531\000001\001.jpg"; $text =~ s/\E$this\Q/$that/go; Untested, but should work. Kill you? Nah. We would just stop visiting this web site if we were that frustrated. (I hope) --Jim Upvote 0 Downvote
$this = "<$@App.ShareDirectory>\Images\Shirley\"; $that = "\\Dell2400\IMAGES\Brian\217531\000001\001.jpg"; $text =~ s/\E$this\Q/$that/go; Untested, but should work. Kill you? Nah. We would just stop visiting this web site if we were that frustrated. (I hope) --Jim
Feb 20, 2002 Thread starter #4 qwert231 Programmer Sep 4, 2001 756 US Actually got it to work like this: foreach $temp(@file_data){ if($temp =~ s/Layout/Job/){print "It changed $temp";} $tempVar1 = index($temp, "<" $tempVar2 = index($temp, ">" if($tempVar1 > -1){ $tempOff = ($tempVar2 + 1) - $tempVar1; substr($temp,$tempVar1,$tempOff,"" } if($temp =~ s/\\Images\\Shirley/$newPath/){print "It changed $temp";} print JOB "$temp"; } First I strip out the <...> stuff then I can search for the \Images\Shirley stuff. Thanks guys. Upvote 0 Downvote
Actually got it to work like this: foreach $temp(@file_data){ if($temp =~ s/Layout/Job/){print "It changed $temp";} $tempVar1 = index($temp, "<" $tempVar2 = index($temp, ">" if($tempVar1 > -1){ $tempOff = ($tempVar2 + 1) - $tempVar1; substr($temp,$tempVar1,$tempOff,"" } if($temp =~ s/\\Images\\Shirley/$newPath/){print "It changed $temp";} print JOB "$temp"; } First I strip out the <...> stuff then I can search for the \Images\Shirley stuff. Thanks guys.