Sign in to follow this  
Followers 0

Merge text files, and split them later

1 post in this topic

Posted

G'day everyone

I'm a translator and I have some less computer literate colleagues. On one of the translation projects, we have a tree with many subdirectories of many levels, with files in them to translate. Opening each file one at a time is time-consuming, especially since many files contain only a line or two to translate.

I want to write a script that will take all files in the tree, and merge them into a single file, with "headers" above each file to identify the path of that file, so that I can later run another script to split the single file back into seperate files in the original tree format.

Please help me think of strategies here.

1. I can read each file and write it to the single file using FileWriteLine, but I suspect that is going to take a long, long time, and the file won't get saved until the very end.

2. I was hoping that it is possible to use a DOS command to merge files (once I have the path of each file), so if anyone knows how to merge UTF-8 files in MS DOS with (important!) the UTF-8 intact (not converted to ANSI/ASCII), please let me know. I'm using Windows XP.

3. I could use two instances of Notepad, and copy from the one and paste to the other. Not elegant, but possibly simple to do. It'll be difficult to use Notepad for splitting, though, because Notepad can't do regex find/replace.

Any other ideas? Or... do you perhaps know of a freeware tool that does this already?

Thanks!

Samuel

Share this post


Link to post
Share on other sites



Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0




  • Recently Browsing   0 members

    No registered users viewing this page.