Page 1 of 1

Insert file contents into another file

Posted: Mon Jan 05, 2009 10:32 pm
by amenzl
I have many html files (over 3500+) which need to be updated due to the fact my original data was corrupted and I did not notice this until after I had manually inserted the data on every file. This took me almost eight days to complete.

Now that I have the correct data located in new files (txt files) I'd like to be able to insert this without having to perform a manual edit for every file. This data I wish to update is one line for some records and over 25 lines for others and is in the middle of the file.

Is there a way in which I can tell AFR to insert the data from the correct file into the one that's bad?

Thank you,

PS Since the correct data is currently in multiple txt files I can temporairly rename the html ones as txt if that is necessary

Re: Insert file contents into another file

Posted: Thu Feb 26, 2009 11:28 pm
by amenzl
Well, I did have to edit the original files, but had the same issue when redesigning another site.

I was able to figure out how to merge the contents of one file into the other. I was working with html files and text files.

Here is what I did:
In the html files to update I found the common spot for the change and inserted REPLACETHISTXT using Advanced Find & Replace (about 600 files)

I then renamed all html files as txt files using a batch file (ren *.htm *.txt) and moved them into their own directory.

I created a batch file to merge the txt files and to save results into a new directory
(copy C:\DirA\1.txt+C:\DirB\1.txt C:\merged_files\1.txt)

I then used Advanced Find & Replace to move the merged data to the correct spot
Search for:
Replace with:

Finally I renamed the txt files to html and voila!

Re: Insert file contents into another file

Posted: Fri Feb 27, 2009 5:20 pm
by anmldr
AFR truly is an amazing app that saves days of work. Just wish that it was available for the Mac.

Re: Insert file contents into another file

Posted: Fri Feb 27, 2009 7:31 pm
by Abacre
AFR will also be available in Mac. I think it will be at the end of this year or the beginning of the next year. But we are planning to release the Mac version of the software.