write to CSV file

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
mgroen
Posts: 97
Joined: 13 Jul 2018, 02:22

write to CSV file

16 Jul 2018, 08:42

I have a while loop defined, in which I would like to write values to csv file,
for example loop value. I would like to have this csv file contain format: value;value;value etc

example:

while (i <= 10)
{
"write i to csv file"
}
close csv file

Who can help me with this? With helpfull code.
User avatar
Scr1pter
Posts: 1272
Joined: 06 Aug 2017, 08:21
Location: Germany

Re: write to CSV file

16 Jul 2018, 09:36

Hi,

FileAppend might be an interesting option for you.

For example, you could use this code:

Code: Select all

Loop, 10
{
	i++
	FileAppend, `n%i%, Your file.csv
}
return
`n is a line break.
This means your result would be:
1
2
3
4
etc.

Otherwise it would be 12345.
If you want it this way, simply remove the `n

Your csv file should be located in the same dir where your ahk script is.
If there is an issue with csv, use txt.

Regards
Please use [code][/code] when posting code!
Keyboard: Logitech G PRO - Mouse: Logitech G502 LS - OS: Windows 10 Pro 64 Bit - AHK version: 1.1.33.09
mgroen
Posts: 97
Joined: 13 Jul 2018, 02:22

Re: write to CSV file

17 Jul 2018, 03:49

that helped very much. Thanks!

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Holarctic, jameswrightesq and 437 guests