 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Author |
Message |
nobody Guest
|
Posted: Thu Mar 18, 2010 8:53 am Post subject: word document |
|
|
Hi ppl..
I am trying to solve write a text fle to a word doc. But seems like my program can't work. Is not writing into the doc file though i have tried the following code:
| Code: |
fileread,data,%A_ScriptDir%/data.txt
Loop, parse, data, `,
{
read= %A_loopfield%
FileAppend,%read%,%A_ScriptDir%/transfer.doc
}
|
the following is the format of my data.txt:
blue,Medium,32,red,large,33
it is seperated by the comma.
As of now it can read the text file seperated by the comma but is not wring into the doc file.
I am using fileappend to write to the doc file. Is it correct?
appreciate the help here. |
|
| Back to top |
|
 |
SoLong&Thx4AllTheFish
Joined: 27 May 2007 Posts: 4999
|
|
| Back to top |
|
 |
Leef_me
Joined: 08 Apr 2009 Posts: 5336 Location: San Diego, California
|
Posted: Thu Mar 18, 2010 9:42 am Post subject: |
|
|
Did you know that Word 'doc' files are not just text? Word adds a lot of formatting.
Your script seems to work for me:
| data.txt wrote: | blue,Medium,32,red,large,33
|
| transfer.txt wrote: | blueMedium32redlarge33
|
I'd probably prefer the results on separate lines by adding `n
| Code: | | FileAppend,`n%read%,%A_ScriptDir%/transfer2.txt |
| transfer2.txt wrote: |
blue
Medium
32
red
large
33
|
|
|
| Back to top |
|
 |
nobody Guest
|
Posted: Fri Mar 19, 2010 12:42 am Post subject: |
|
|
Hi Leef_me
Thanks for your help.
But is there a way for me to input the text in the text file to MS word?
Seems like it works only for text format using my script..
I need it in word format...
Need your advice..
thanks! |
|
| Back to top |
|
 |
jaco0646
Joined: 07 Oct 2006 Posts: 3113 Location: MN, USA
|
|
| Back to top |
|
 |
|
|
You can post new topics in this forum You can reply to topics in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|