 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Author |
Message |
0mega
Joined: 17 May 2007 Posts: 38
|
Posted: Tue Sep 16, 2008 8:19 pm Post subject: Add text front of the line |
|
|
Example:
!z::FileAppend , Text, Filename.txt
And if I moment later press exmp. !x it would add some text front of the line of textfile. Is it possible ?
It need add text front of line to latest row on textfile |
|
| Back to top |
|
 |
Sivvy
Joined: 21 Jul 2008 Posts: 726 Location: Calgary, AB, Canada
|
Posted: Tue Sep 16, 2008 8:41 pm Post subject: |
|
|
| Look in Help for "FileReadLine". Read the last line, add your text to the front, then Re-Append it. |
|
| Back to top |
|
 |
SoLong&Thx4AllTheFish
Joined: 27 May 2007 Posts: 4999
|
|
| Back to top |
|
 |
SKAN
Joined: 26 Dec 2005 Posts: 8688
|
Posted: Tue Sep 16, 2008 8:52 pm Post subject: |
|
|
| Code: | !z::
FileDelete, FileName.txt
FileAppend , Line1`nLine2`nLine3`nLine4`nLine5, Filename.txt
Return
!x::
FileRead , Text, Filename.txt
LengthOfText := StrLen( Text )
LineFeedPosition := InStr( Text, "`n",0,0 )
If not LineFeedPosition
Return
Prefix := SubStr( Text, 1, LineFeedPosition - 1 )
Suffix := SubStr( Text, LineFeedPosition+1, LengthOfText-LineFeedPosition )
NewText := Prefix "`n" A_Now "`n" Suffix
MsgBox, % NewText
FileDelete, FileName.txt
FileAppend, %NewText%, FileName.txt
Return |
_________________ URLGet - Internet Explorer based Downloader |
|
| Back to top |
|
 |
Omega Guest
|
Posted: Wed Sep 17, 2008 5:04 pm Post subject: |
|
|
| Thanks to all |
|
| 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
|