File append in specific line (Possible?)

Get help with using AutoHotkey and its commands and hotkeys
asdads
Posts: 13
Joined: 07 Feb 2018, 09:45

File append in specific line (Possible?)

19 Jun 2018, 08:33

Hello,

I have one simple question..
How can I use "FileAppend" to write a certain text in a certain line?

Thanks :D
wolf_II
Posts: 2123
Joined: 08 Feb 2015, 20:55

Re: File append in specific line (Possible?)

19 Jun 2018, 08:50

Try this:
  • run the script
  • press F12 three times
  • check the effect of 3 insertions at Line #8 into the script

Code: [Select all] [Expand] [Download] GeSHi © Codebox Plus

I hope that helps.
Guest

Re: File append in specific line (Possible?)

19 Jun 2018, 09:37

If you need to do more there is the TF library with 40+ functions incl. TF_InsertLine @ https://github.com/hi5/TF
User avatar
jeeswg
Posts: 4994
Joined: 19 Dec 2016, 01:58
Location: UK

Re: File append in specific line (Possible?)

19 Jun 2018, 11:29

With InStr you can get the nth occurrence of a string.
asdads
Posts: 13
Joined: 07 Feb 2018, 09:45

Re: File append in specific line (Possible?)

20 Jun 2018, 09:38

wolf_II wrote:Try this:
  • run the script
  • press F12 three times
  • check the effect of 3 insertions at Line #8 into the script

Code: [Select all] [Expand] [Download] GeSHi © Codebox Plus

I hope that helps.


First of all thanks for the answer but..

Thats good but not that what i need :/

Let´s say i have two files called text.txt and insert.ahk, i open insert and it insert the text into text.txt

I already tryed F12:: InsertLine("; Hi " MyPath, 8)

But i get an Error message
wolf_II
Posts: 2123
Joined: 08 Feb 2015, 20:55

Re: File append in specific line (Possible?)

20 Jun 2018, 12:01

Try F12:: InsertLine("; Hi", MyPath, 8) notice the two , around MyPath.
asdads
Posts: 13
Joined: 07 Feb 2018, 09:45

Re: File append in specific line (Possible?)

21 Jun 2018, 07:38

wolf_II wrote:Try F12:: InsertLine("; Hi", MyPath, 8) notice the two , around MyPath.


How can i just show you my love ?, thanks <3

Return to “Ask For Help”

Who is online

Users browsing this forum: AlphaBravo and 19 guests