# Stripping code from old WordPro file

**URL:** <https://boards.straightdope.com/t/stripping-code-from-old-wordpro-file/998653>\
**Category:** Factual Questions\
**Created:** [March 9, 2024, 6:24pm UTC](https://boards.straightdope.com/t/stripping-code-from-old-wordpro-file/998653 "2024-03-09T18:24:23Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![LucyInDisguise](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/lucyindisguise/32/18064_2.png) [@LucyInDisguise](https://boards.straightdope.com/u/LucyInDisguise)\
**Post date:** [March 9, 2024, 6:24pm UTC](https://boards.straightdope.com/t/stripping-code-from-old-wordpro-file/998653/1 "2024-03-09T18:24:23Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![beowulff](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/beowulff/32/542_2.png) [@beowulff](https://boards.straightdope.com/u/beowulff)\
**Post date:** [March 9, 2024, 6:42pm UTC](https://boards.straightdope.com/t/stripping-code-from-old-wordpro-file/998653/2 "2024-03-09T18:42:41Z")

</div>

[grep](https://en.wikipedia.org/wiki/Grep)?

---

<div class="post-metadata">

**Author:** ![markn\_1](https://avatars.discourse-cdn.com/v4/letter/m/f9ae1b/32.png) [@markn\_1](https://boards.straightdope.com/u/markn_1)\
**Post date:** [March 9, 2024, 6:49pm UTC](https://boards.straightdope.com/t/stripping-code-from-old-wordpro-file/998653/3 "2024-03-09T18:49:17Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![LucyInDisguise](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/lucyindisguise/32/18064_2.png) [@LucyInDisguise](https://boards.straightdope.com/u/LucyInDisguise)\
**Post date:** [March 9, 2024, 6:49pm UTC](https://boards.straightdope.com/t/stripping-code-from-old-wordpro-file/998653/4 "2024-03-09T18:49:33Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![LucyInDisguise](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/lucyindisguise/32/18064_2.png) [@LucyInDisguise](https://boards.straightdope.com/u/LucyInDisguise)\
**Post date:** [March 9, 2024, 6:55pm UTC](https://boards.straightdope.com/t/stripping-code-from-old-wordpro-file/998653/5 "2024-03-09T18:55:01Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![beowulff](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/beowulff/32/542_2.png) [@beowulff](https://boards.straightdope.com/u/beowulff)\
**Post date:** [March 9, 2024, 6:55pm UTC](https://boards.straightdope.com/t/stripping-code-from-old-wordpro-file/998653/6 "2024-03-09T18:55:33Z")

</div>

grep has no problems stripping out codes embedded in the middle of lines.

---

<div class="post-metadata">

**Author:** ![LucyInDisguise](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/lucyindisguise/32/18064_2.png) [@LucyInDisguise](https://boards.straightdope.com/u/LucyInDisguise)\
**Post date:** [March 9, 2024, 6:57pm UTC](https://boards.straightdope.com/t/stripping-code-from-old-wordpro-file/998653/7 "2024-03-09T18:57:35Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![beowulff](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/beowulff/32/542_2.png) [@beowulff](https://boards.straightdope.com/u/beowulff)\
**Post date:** [March 9, 2024, 6:57pm UTC](https://boards.straightdope.com/t/stripping-code-from-old-wordpro-file/998653/8 "2024-03-09T18:57:51Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![gnoitall](https://avatars.discourse-cdn.com/v4/letter/g/bb73d2/32.png) [@gnoitall](https://boards.straightdope.com/u/gnoitall)\
**Post date:** [March 9, 2024, 6:58pm UTC](https://boards.straightdope.com/t/stripping-code-from-old-wordpro-file/998653/9 "2024-03-09T18:58:04Z")

</div>

> [@LucyInDisguise](#):
>
> old WordPro files

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/](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.

---

<div class="post-metadata">

**Author:** ![LucyInDisguise](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/lucyindisguise/32/18064_2.png) [@LucyInDisguise](https://boards.straightdope.com/u/LucyInDisguise)\
**Post date:** [March 9, 2024, 6:59pm UTC](https://boards.straightdope.com/t/stripping-code-from-old-wordpro-file/998653/10 "2024-03-09T18:59:41Z")

</div>

Files no longer .lwp format. I was pretty much forced to save them as .txt in order to not lose them all together.

Lucy

---

<div class="post-metadata">

**Author:** ![DPRK](https://avatars.discourse-cdn.com/v4/letter/d/4491bb/32.png) [@DPRK](https://boards.straightdope.com/u/DPRK)\
**Post date:** [March 9, 2024, 7:00pm UTC](https://boards.straightdope.com/t/stripping-code-from-old-wordpro-file/998653/11 "2024-03-09T19:00:01Z")

</div>

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

> [@LucyInDisguise](#):
>
> Files no longer .lwp format. I was pretty much forced to save them as .txt in order to not lose them all together.

If it’s _really_ a text file (doesn’t look like it), you could maybe pipe it through `tr -cd "[:print:]"`

---

<div class="post-metadata">

**Author:** ![gnoitall](https://avatars.discourse-cdn.com/v4/letter/g/bb73d2/32.png) [@gnoitall](https://boards.straightdope.com/u/gnoitall)\
**Post date:** [March 9, 2024, 7:01pm UTC](https://boards.straightdope.com/t/stripping-code-from-old-wordpro-file/998653/12 "2024-03-09T19:01:41Z")

</div>

> [@DPRK](#):
>
> That excerpt is not a .txt file, looks like a lwp file

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).

---

<div class="post-metadata">

**Author:** ![AHunter3](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/ahunter3/32/368_2.png) [@AHunter3](https://boards.straightdope.com/u/AHunter3)\
**Post date:** [March 9, 2024, 7:10pm UTC](https://boards.straightdope.com/t/stripping-code-from-old-wordpro-file/998653/13 "2024-03-09T19:10:50Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![LucyInDisguise](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/lucyindisguise/32/18064_2.png) [@LucyInDisguise](https://boards.straightdope.com/u/LucyInDisguise)\
**Post date:** [March 9, 2024, 7:18pm UTC](https://boards.straightdope.com/t/stripping-code-from-old-wordpro-file/998653/14 "2024-03-09T19:18:00Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![BigT](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/bigt/32/12044_2.png) [@BigT](https://boards.straightdope.com/u/BigT)\
**Post date:** [March 9, 2024, 7:18pm UTC](https://boards.straightdope.com/t/stripping-code-from-old-wordpro-file/998653/15 "2024-03-09T19:18:42Z")

</div>

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.

> **[Online LWP to TXT Converter](https://www.vertopal.com/en/convert/lwp-to-txt)**
>
> Convert LWP documents to TXT file format using Vertopal free online converter tools. You can edit and optimize your documents.

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.

---

<div class="post-metadata">

**Author:** ![markn\_1](https://avatars.discourse-cdn.com/v4/letter/m/f9ae1b/32.png) [@markn\_1](https://boards.straightdope.com/u/markn_1)\
**Post date:** [March 9, 2024, 7:19pm UTC](https://boards.straightdope.com/t/stripping-code-from-old-wordpro-file/998653/16 "2024-03-09T19:19:07Z")

</div>

> [@beowulff](#):
>
> grep has no problems stripping out codes embedded in the middle of lines.

Can you give an example of that? I don’t see how that’s possible. Are you sure you’re not thinking of sed?

---

<div class="post-metadata">

**Author:** ![LucyInDisguise](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/lucyindisguise/32/18064_2.png) [@LucyInDisguise](https://boards.straightdope.com/u/LucyInDisguise)\
**Post date:** [March 9, 2024, 7:25pm UTC](https://boards.straightdope.com/t/stripping-code-from-old-wordpro-file/998653/17 "2024-03-09T19:25:48Z")

</div>

Gave it my best shot. That converter just successfully converted the file into an identical copy of the original.

---

<div class="post-metadata">

**Author:** ![DPRK](https://avatars.discourse-cdn.com/v4/letter/d/4491bb/32.png) [@DPRK](https://boards.straightdope.com/u/DPRK)\
**Post date:** [March 9, 2024, 7:26pm UTC](https://boards.straightdope.com/t/stripping-code-from-old-wordpro-file/998653/18 "2024-03-09T19:26:53Z")

</div>

> [@LucyInDisguise](#):
>
> Trying to open the file with the .lwp extension

Trying to open it in what application? Word Pro itself? LibreOffice? A text editor?

> [@LucyInDisguise](#):
>
> but saving it as a .lwp file doesn’t change the fact that the content of the file is .txt

What steps were used to save it as a “.txt” in the first place? Perhaps they can be reversed.

---

<div class="post-metadata">

**Author:** ![BigT](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/bigt/32/12044_2.png) [@BigT](https://boards.straightdope.com/u/BigT)\
**Post date:** [March 9, 2024, 7:28pm UTC](https://boards.straightdope.com/t/stripping-code-from-old-wordpro-file/998653/19 "2024-03-09T19:28:26Z")

</div>

> [@LucyInDisguise](#):
>
> Gave it my best shot. That converter just successfully converted the file into an identical copy of the original. ⁢

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.

---

<div class="post-metadata">

**Author:** ![LucyInDisguise](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/lucyindisguise/32/18064_2.png) [@LucyInDisguise](https://boards.straightdope.com/u/LucyInDisguise)\
**Post date:** [March 9, 2024, 7:45pm UTC](https://boards.straightdope.com/t/stripping-code-from-old-wordpro-file/998653/20 "2024-03-09T19:45:35Z")

</div>

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

[Next page](https://boards.straightdope.com/t/stripping-code-from-old-wordpro-file/998653.md?page=2)
