AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Convert TXT to DOC
Goto page 1, 2  Next
 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
nod32
Guest





PostPosted: Tue Jan 16, 2007 2:05 pm    Post subject: Convert TXT to DOC Reply with quote

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

PostPosted: Tue Jan 16, 2007 2:20 pm    Post subject: Reply with quote

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
View user's profile Send private message
nod32
Guest





PostPosted: Tue Jan 16, 2007 2:44 pm    Post subject: Reply with quote

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

PostPosted: Tue Jan 16, 2007 3:06 pm    Post subject: Reply with quote

i dont mean to be complicated Razz but i just tried it again with a bunch of tabs and word opened it and formatted it correctly
Back to top
View user's profile Send private message
BoBo
Guest





PostPosted: Tue Jan 16, 2007 3:07 pm    Post subject: Reply with quote

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)

PostPosted: Tue Jan 16, 2007 3:12 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
adamrgolf



Joined: 28 Dec 2006
Posts: 362

PostPosted: Tue Jan 16, 2007 3:13 pm    Post subject: Reply with quote

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 Smile
Back to top
View user's profile Send private message
BoBo
Guest





PostPosted: Tue Jan 16, 2007 3:18 pm    Post subject: Reply with quote

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

PostPosted: Tue Jan 16, 2007 5:15 pm    Post subject: Reply with quote

Google for the win!

I did a google search on "TEXT to DOC" and found a freeware program that should do want you want:
txt2pdbdoc
http://homepage.mac.com/pauljlucas/software/txt2pdbdoc/

One hitch, it's for unix. Sad

Then I did a Search for "TEXT to DOC conversion" and found a shareware program that seems to perform to function you're looking for:

http://www.softinterface.com/Convert-File-Programs/Convert-File-Program.HTM

Hope that helps Smile
Back to top
View user's profile Send private message
PhiLho



Joined: 27 Dec 2005
Posts: 6721
Location: France (near Paris)

PostPosted: Tue Jan 16, 2007 6:23 pm    Post subject: Reply with quote

Jaytech wrote:
One hitch, it's for unix. Sad
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
View user's profile Send private message Visit poster's website
garry



Joined: 19 Apr 2005
Posts: 1035
Location: switzerland

PostPosted: Tue Jan 16, 2007 6:58 pm    Post subject: Reply with quote

this don't save xy.txt to xy.doc , but print-out like doc
I used it to print out from autohotkey a text result with different fonts and picture

Here a small command line tool wich writes textfile xy.txt like document
(font ,left margin,pictures ...)
for better understanding print out anleit.txt with notepad and then use command
rghdruck Anleit.txt > see print as doc with fonts and picture

rghdruck Anleit.txt , PRINT
rghlist Anleit.txt ;VIEW
http://www.profan.de/
http://www.profan.de/download/rghdruck.zip

http://www.autohotkey.com/forum/topic14459.html&highlight=txt+doc
Back to top
View user's profile Send private message
neyon



Joined: 29 May 2005
Posts: 34
Location: The Netherlands

PostPosted: Wed Jan 17, 2007 10:52 am    Post subject: Reply with quote

Or download this freeware:

http://www.highdots.com/text-code-export/

It can convert to rtf/doc.
_________________
Greetz,
Neyon
Back to top
View user's profile Send private message
nod32
Guest





PostPosted: Wed Jan 17, 2007 3:07 pm    Post subject: Reply with quote

Thanks to all Very Happy

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)

PostPosted: Wed Jan 17, 2007 4:06 pm    Post subject: Reply with quote

Convert Text file to Image perhaps...
_________________
vPhiLho := RegExReplace("Philippe Lhoste", "^(\w{3})\w*\s+\b(\w{3})\w*$", "$1$2")
Back to top
View user's profile Send private message Visit poster's website
nod32
Guest





PostPosted: Wed Jan 17, 2007 4:36 pm    Post subject: Reply with quote

Thanks but I created this topic too Wink

I think it'll be difficult.

Any other ideas ?
Back to top
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group