Noob here...
I have been at this off and on for days.
I have searched and read and experimented but now at a dead end.
I have a large file that I have stringsplit and appended to C:\TestIn\
C:\TestIn might now contain up to 500 files.
I want to sum the individual files. Each of which may contain eg:
0.60
1.20
.008
and append to C:\TestOut, but not sum the lot. So I end up with up to 500 files with the individual sums in each file eg:
1.88
I have this and tried many variations but it appends the sum to the next file
FileRead,T, C:\TestIn\%A_Index%.TXT
Loop, parse,T, `n `r
Sum+= A_LoopField
FileDelete,C:\TestOut\*.txt
FileAppend, %Sum%,C:\TestOut\%A_Index%.txt
Thanks for any help.
summing Topic is solved
- SpeedMaster
- Posts: 494
- Joined: 12 Nov 2016, 16:09
Re: summing
FileDelete,C:\TestOut\*.txt ----------> with this command, you will only end up with one filegregraphic wrote:and append to C:\TestOut ... So I end up with up to 500 files
Reset variable Sum to zero after each iteration of the loop Sum:=0gregraphic wrote:...but it appends the sum to the next file
Code: Select all
loop, 500 {
FileRead,T, C:\TestIn\%A_Index%.TXT
Loop, parse,T, `n `r
Sum += A_LoopField
FileAppend, %Sum% , C:\TestOut\%A_Index%.txt
sum:=0
}
Re: summing
Thanks very much. I appreciate your time.
I'll keep learning.....
I'll keep learning.....
Who is online
Users browsing this forum: RussF and 372 guests