| View previous topic :: View next topic |
| Author |
Message |
nod32 Guest
|
Posted: Tue Jan 16, 2007 2:05 pm Post subject: Convert TXT to DOC |
|
|
Hi,
I need an utility (command line) that can convert PLAIN TEXT (.txt) files to Microsoft Word or OpenOffice.org Writer format (.doc).
I tried some ABBYY's poducts with no success [I haven't found the command line syntax].
Any ideas ?
Thank you. |
|
| Back to top |
|
 |
adamrgolf
Joined: 28 Dec 2006 Posts: 362
|
Posted: Tue Jan 16, 2007 2:20 pm Post subject: |
|
|
| i just saved a .txt file with a bunch of text in it, and then just renamed it to .doc and it opened fine in word... maybe you just need to do a batch file extenstion rename |
|
| Back to top |
|
 |
nod32 Guest
|
Posted: Tue Jan 16, 2007 2:44 pm Post subject: |
|
|
Hi,
I know we can change the extension - easy -.
But, my text isn't always plain text, for example, I sometimes use a TAB.
Word and OO.org Writer have problems with.
I would only know if a command line program can do that (more reliable than changing the extension) ?
Thank you. |
|
| Back to top |
|
 |
adamrgolf
Joined: 28 Dec 2006 Posts: 362
|
Posted: Tue Jan 16, 2007 3:06 pm Post subject: |
|
|
i dont mean to be complicated but i just tried it again with a bunch of tabs and word opened it and formatted it correctly |
|
| Back to top |
|
 |
BoBo Guest
|
Posted: Tue Jan 16, 2007 3:07 pm Post subject: |
|
|
Docs are formated text (underlined text/bold/embedded objects like images etc.), while txt is plain/raw ASCII text. Therefore it's not just a simple change of a files extension.
Have a try, open a 'real' word document in Notepad! |
|
| Back to top |
|
 |
PhiLho
Joined: 27 Dec 2005 Posts: 6721 Location: France (near Paris)
|
Posted: Tue Jan 16, 2007 3:12 pm Post subject: |
|
|
BoBo, we are talking about the reverse operation, ie. opening a plain text in a wordprocessor. The later should be able to open it without a problem.
I don't understand nod32's issue, perhaps there are controls characters beside simple tabs. _________________
vPhiLho := RegExReplace("Philippe Lhoste", "^(\w{3})\w*\s+\b(\w{3})\w*$", "$1$2") |
|
| Back to top |
|
 |
adamrgolf
Joined: 28 Dec 2006 Posts: 362
|
Posted: Tue Jan 16, 2007 3:13 pm Post subject: |
|
|
| BoBo wrote: | | Have a try, open a 'real' word document in Notepad! |
well, yea i know its not "backwards compatible" but he didn't say anything about needing to convert it back to re-open it in notepad (i assume) -- if thats the case he could always do a file copy too...
i'm not trying to avoid the problem, just throwing out the first solution that came to mind  |
|
| Back to top |
|
 |
BoBo Guest
|
Posted: Tue Jan 16, 2007 3:18 pm Post subject: |
|
|
| Quote: | | BoBo, we are talking about the reverse operation, ie. opening a plain text in a wordprocessor. | Which I'm aware of. It's just to point out that a simple renaming won't be the same as a conversion. To open a native/real Word.doc in Notepad should show that (as it should end up as a bunch of cryptic garbage). There's no doubt that Winword is able to open plain text (of course with its *.txt extension too!), the lowest standard of word processing. |
|
| Back to top |
|
 |
Jaytech
Joined: 11 Dec 2006 Posts: 244 Location: Orlando, FL
|
|
| Back to top |
|
 |
PhiLho
Joined: 27 Dec 2005 Posts: 6721 Location: France (near Paris)
|
Posted: Tue Jan 16, 2007 6:23 pm Post subject: |
|
|
| Jaytech wrote: | One hitch, it's for unix.  | Another hitch, that's not the right format: "A Doc file is a defacto standard file format for text documents for PalmOS document reader applications."...
There are some utilities to do such conversion. For example, the well known (?) AFT is able to format a plain text file to RTF following some rules.
There are other simple markup languages, like Markdown, [quote=http://www.textism.com/tools/textile/]Textile[/quote], etc. Or even our familiar BBCode...
I found an example of Markdown to RTF: http://sophos.berkeley.edu/macfarlane/pandoc/ _________________
vPhiLho := RegExReplace("Philippe Lhoste", "^(\w{3})\w*\s+\b(\w{3})\w*$", "$1$2") |
|
| Back to top |
|
 |
garry
Joined: 19 Apr 2005 Posts: 1035 Location: switzerland
|
|
| Back to top |
|
 |
neyon
Joined: 29 May 2005 Posts: 34 Location: The Netherlands
|
|
| Back to top |
|
 |
nod32 Guest
|
Posted: Wed Jan 17, 2007 3:07 pm Post subject: |
|
|
Thanks to all
I've already tried http://www.highdots.com/text-code-export/ but it doesn't work in command line ...
Now I'm looking for something special :
With FileAppend, I want to write (for example) "AutoHotKey is nice".
Not difficult...
But I want this text to be RED, then convert the red text to a jpg picture [not possible with PLAIN TEXT unhappily]. Or convert TXT to DOC, apply the color, then convert the DOC to JPG.
Any ideas to do that ? |
|
| Back to top |
|
 |
PhiLho
Joined: 27 Dec 2005 Posts: 6721 Location: France (near Paris)
|
Posted: Wed Jan 17, 2007 4:06 pm Post subject: |
|
|
Convert Text file to Image perhaps... _________________
vPhiLho := RegExReplace("Philippe Lhoste", "^(\w{3})\w*\s+\b(\w{3})\w*$", "$1$2") |
|
| Back to top |
|
 |
nod32 Guest
|
Posted: Wed Jan 17, 2007 4:36 pm Post subject: |
|
|
Thanks but I created this topic too
I think it'll be difficult.
Any other ideas ? |
|
| Back to top |
|
 |
|