Copy different items in different files

Tool for Search and Replace across multiple files.
Post Reply
NoviceUser
Posts: 2
Joined: Wed Apr 08, 2015 7:45 pm

Copy different items in different files

Post by NoviceUser »

Hello everyone,
I am very new at this kind of thing, and need some help from my fellow users. I do have the pro version already as i am quite sure a batch process is going to be required for what I need. I have created a .bat file to copy a page hundreds of times with file names from a list I had created in Excel. I now have a list in Excel with the first 4 items in column A being the existing text i want to find, and 4 items in column b being what i want to replace it with. This goes on and on and on.

M139_D2_10A UnitA01.Cell_State M139_D2_10A UnitA01.Cell_State
M139_D2_10A UnitA02.Cell_State M139_D2_10A UnitA02.Cell_State
M139_D2_10A UnitA03.Cell_State M139_D2_10A UnitA03.Cell_State
M139_D2_10A UnitA04.Cell_State M139_D2_10A UnitA04.Cell_State
M139_D2_10A UnitA01.Cell_State M139_D2_10A UnitA05.Cell_State
M139_D2_10A UnitA02.Cell_State M139_D2_10A UnitA06.Cell_State
M139_D2_10A UnitA03.Cell_State M139_D2_10A UnitA07.Cell_State
M139_D2_10A UnitA04.Cell_State M139_D2_10A UnitA08.Cell_State
M139_D2_10A UnitA01.Cell_State M139_D2_10A UnitA09.Cell_State
M139_D2_10A UnitA02.Cell_State M139_D2_10A UnitA10.Cell_State
M139_D2_10A UnitA03.Cell_State M139_D2_10A UnitA11.Cell_State
M139_D2_10A UnitA04.Cell_State M139_D2_10A UnitA12.Cell_State

File names read as follows.
Battery Data M139_D2_10A_A01_A04.aspx
Battery Data M139_D2_10A_A05_A08.aspx
Battery Data M139_D2_10A_A09_A012.aspx
Battery Data M139_D2_10A_A013_A016.aspx
Battery Data M139_D2_10A_A017_A020.aspx
Battery Data M139_D2_10A_A021_A024.aspx


What i am needing is for it to run the first 4 rows on file 1, goto file 2 do the next 4 rows, rinse repeat until end of file. Any help would be much appreciated in this matter. I will be doing the same exact thing with 7 other words but assume it can all be extrapolated from 1 instance and referenced to the remaining 7. I look forward to any advice, and hope i can be of help to someone else in the future.
User avatar
DigitalVolcano
Site Admin
Posts: 1724
Joined: Thu Jun 09, 2011 10:04 am

Re: Copy different items in different files

Post by DigitalVolcano »

You can import the list into the program using the Import button in the batch processor. (You need to export from excel into a tab separated file first).

The stumbling point is that you can't currently get it to switch input/output file mid batch though. (on the to-do list)

Can you run all the rows on every file? If the phrases don't occur in the other files they will be ignored.
NoviceUser
Posts: 2
Joined: Wed Apr 08, 2015 7:45 pm

Re: Copy different items in different files

Post by NoviceUser »

Thanks for the reply,
I did export to a tab separated file and imported that and tried to run it, ran the 1st group of replace on every file. Every file I am writing to is exactly the same currently as i just copied 1 file 160 times and renamed it from a list i had built using a .bat file. When i try to run all the lines, every file gets changed to the 1st find/replace function making all the files exactly the same again just number 2 on the list instead of number 1. I saw you were working on changing files mid-batch, that sounds like what I am looking for. I am doing my search based on a folder, if you could make a command that just does something like, move to next file in folder, that i could stick in between each group of words i need replaced i think that would be the perfect remedy. Any other ideas that might work in the mean time would be much appreciated.

Thank you again.

P.S. the replace with file name is something i never thought of needing until i started this project and it worked so well, great piece of software!
Post Reply