I have a bunch of old WordPro files that had to be saved in a .txt format. Is there a program out there that will strip the code out of these files and leave just the original text?
Lucy
I have a bunch of old WordPro files that had to be saved in a .txt format. Is there a program out there that will strip the code out of these files and leave just the original text?
Lucy
grep?
grep would work only if the desired text is always on separate lines from the undesired text, and there is a regular expression that can distinguish between them.
OP, if you can point to an sample of one of these files so we can see what it looks like, we could give a better answer.
I should probably add that these wordpro files were saved in .txt because my PC died and I converted to a mac mini. I could probably spend a few months going through them line by line and strip out the code manually, but it occurs to me that there may be a program out there somewhere that could automate the process, or at least make it a little easier.
Lucy
Best I can do is copy and paste the first few lines of one of the files:
WordProLWP7ˇˇˇˇ.a’a!‰—5¨BWord Pro Text File/DFBâ§C~¿@PP@eõANSI (Windows, IBM CP 1252)@ âAll RulesP-P@
çROUTINE WORLDP@
ïGlen L. JonesP“⁄+¶'EAQB@@@
åMy NameH@BGLJH@
âMy NameH@AGJXP
¿p@@
çMy Name@FGLJˇˇˇˇX@@@q
¿pcPP@@q ¿pcPP
¿@eõUNIVERSAL_ALL_OTHERS_EDITOR@FOTRˇˇˇˇX@@@q
¿pcPP@@q ¿pcPP
¿@
äMy Name@EGJˇˇˇˇX@@@q
¿pcPP@@q ¿pcPP
aîD¡@QEB
PP ¿p©îºî™¡ãxT¯p=
Not all characters are translating from copy to paste accurately.
Lucy
grep has no problems stripping out codes embedded in the middle of lines.
From what I’ve been able to learn about grep in the last few minutes, that my be above my pay grade. Or, more accurately, skill level.
You would need to analyze the structure of the codes.
A quick glance shows that some start with “@” and end with “@“
But, you would need to to that with all of them.
As in, Lotus Word Pro? Filename extension “.lwp”?
Apparently, Libreoffice can convert those to other formats, including text. Either on the command line, using the “–convert-to” flag:
https://www.reddit.com/r/libreoffice/comments/10xxfqr/tip_convert_documents_on_command_line_with/
Or you can just load the document and then save-as.
Files no longer .lwp format. I was pretty much forced to save them as .txt in order to not lose them all together.
Lucy
Yes, I was going to say, LibreOffice can open .lwp files (maybe you have to enable the plug-in manually). .txt is a text file, so was going to ask what you mean by “codes”. That excerpt is not a .txt file, looks like a lwp file
If it’s really a text file (doesn’t look like it), you could maybe pipe it through tr -cd "[:print:]"
This.
You may have had to change the filename extension, but that doesn’t make it a text file. It’s still an LWP file unless you actually damaged it in the process of exfiltrating it from whatever bondage you were talking about, so should still process as an LWP (with or without changing the filename back).
If all else fails, I have WordPro (and older AmiPro) on ancient virtual machines and can open them natively and save them in whatever format you want and send them back to you.
Well, the content of the file contains all of the coding from the .lwp document, but saving it as a .lwp file doesn’t change the fact that the content of the file is .txt
Trying to open the file with the .lwp extension results in a +/- 93 page document that still contains all of the coding (original text was only 3 pages). It’s only marginally better than the .txt file in that some of the code converts to page breaks.
Yeah, those look like LWP files with a TXT extension.
I’d probably first try using an online converter that converts LWP to TXT, like this one. It will hopefully ignore the file extension.
Assuming, of course, there’s no sensitive data in them. The site does have a privacy policy that seems fine, so I’d use it for stuff that wasn’t really private, but I would avoid it for truly sensitive content.
Can you give an example of that? I don’t see how that’s possible. Are you sure you’re not thinking of sed?
Gave it my best shot. That converter just successfully converted the file into an identical copy of the original.
Trying to open it in what application? Word Pro itself? LibreOffice? A text editor?
What steps were used to save it as a “.txt” in the first place? Perhaps they can be reversed.
I would then try renaming the original file to .lwp instead of .txt and try again. But, if that doesn’t work, then the converter probably won’t work–the files probably aren’t actually LWP files, but some weird mangling of them.
Well, I’ve tried Pages, Two different online converters, and my mac’s text editor. Originally, I tried to import the WordPro documents into my mac when I made the switch, but there were issues with any of the documents that had extensive formating. Those just refused to move. The PC was in it’s final death throws, and the last time I got it to boot I just save those files to .txt and put them on a CD which I then moved to the Mac. That was back in 2004 - they’ve just been sitting here on my Mac waiting until I had the time to go through them and strip out the extraneous code. I’ve done 6 files, but the time involved makes me wonder about the actual value of trying to save the data in these files …
Lucy