I have a text file which was with nice linebreaks. By mistake my customer opened it in wordpad an saved it. All line breaks are now gone.
Is there a way to restore the line breaks again?
|
|
If the customer just opened it in Wordpad and saved it, that would just mean the linebreaks are Windows (CR+LF) as I understand it. In that situation you can use any decent text editor that understands/converts between different linebreaks. But then I guess you wouldn't be posting if it was that simple. Can you give more details on what the customer did? Are you sure the customer didn't delete the linebreaks? The best way to understand what you have in your translated file is to use a hex editor to inspect it, and see what lies around the areas where there should be linebreaks. If there's nothing in the file to separate different lines then I think you're pretty much stuffed. |
||||
|
Open it in wordpad, ctrl+c, ctr+v in notepad and it is all folks :) |
|||
|
|
|
Is my answer to simple just put them back in, express to the customer where they were before the translation and let them manually put them back in. |
|||
|
Is there some kind of grammatical pattern to the file that can be used to insert the linebreaks? Of course, it'd be real convenient if there were periods preceding where all the former linebreaks were, but that's probably not the case. However, there might still be other patterns. For instance, if these are flash messages for a CRUD application, you might have patterns like:
If you can come up with a creative way to figure out where the linebreaks need to go, then you could probably write a script to put them back in. What I can't understand is, while the customer was editing the file, surely he noticed that there weren't linebreaks. What did he expect would be used to delimit the separate messages? Did he put commas in their place? If he just translated the entire 2900+ line file without putting any separator between the separate lines, then, sad to say, this is his punishment for lacking commonsense. |
|||
|
|