Is this possable? String replace with Directory path

General discussions about Advanced Find and Replace
Post Reply
Loki008
Posts: 1
Joined: Mon May 16, 2005 2:59 pm
Location: Hartford, CT
Contact:

Is this possable? String replace with Directory path

Post by Loki008 » Mon May 16, 2005 3:16 pm

i have a directory containing several sub directories with images and a text file acting as an index for those images... basically what that file looks like is

VN,F123456,X:\User\Project\F123 456R\,99
IM,F123-456-9000001,D,1,@F123456;;doc1.pdf;5
IM,F123-456-9000002, ,2,@F123456;;doc1.pdf;5
IM,F123-456-9000001,D,1,@F123456;;doc2.pdf;5

ect...

what i need to do for when the files are moved from the local directory to the server is replace the X:\ with a DFS path. right now i am just deleteing the first line and manually creating the volume path on the server. the second line is the image info, what i neeed to do here is take the \Project\F123 456R\ from the first line and place it where the ;; is.

basically what i am looking for is a way to take the path from the line above and replace it in between the ;; this has to be automated because it will be processing up to several hundred sub directories. also each subdirectory has its own index file, so its not like this is one file i am editing

also i would like to be able to then replace the path, for example change

VN,F123456,X:\User\Project\F123 456R\,99

into

VN,F123456,\\Clientname\UserImages\,99

any help on these 2 replacements would be greatly appreciated

thanks
adam

Abacre
Site Admin
Posts: 1198
Joined: Mon Jan 31, 2005 5:32 pm
Contact:

Post by Abacre » Thu Jun 02, 2005 4:04 pm

Hi Adam,

Yes, it's possible to do it with AFR.

What should you do for the first case:
Please download the latest version of the program:
http://www.abacre.com/download/afrexe.zip

This is only updated EXE file. You need to extract executable file from
zip archive into folder where the program is installed. So you will
replace old executable file by this new one.

Start the program. Go to main menu - Action - Options - "Batch
replace" check on the options:
Replace until found is ON
Modifier S is ON.

Press OK.

In main window go to Batch replace tab.
Check on "Use regular expressions".
Then fill the grid:
Search for:
(VN,.+,.+:\\.+)(\\.+)(,.+\r\n.*IM,.+,.+,.+,.+);;
Replace with:
$1$2$3;$2;

That's all. You may press now Execute button.
I verified it perfectly works.

For the second case you may use, for example, the search for:
(VN,.+,)X:\User\Project\F123 456R\,
replace with:
$1\\Clientname\UserImages\,
Kind regards,
Abacre Limited
http://www.abacre.com
support@abacre.com

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests