@little Fairy...
how do I adjust the code so it stops adding "|" after each line? I've tried for hours trying to adjust the code but it seems I can only get it to remove"|" after each colon.
Can you help me out?
Code:
#Include tf.ahk
;TF_TrimRight("!atest2.csv","","",5)
FileSelectFile, files, M3, , Open one or more "atest"s ;files stores the upload file.
if files =
ExitApp
FileSelectFile, LookupFile, 3, , Open the "btest", ;LookupFile stores the map file.
if LookupFile =
ExitApp
FileSelectFolder, OutputFolder, , 3 ;stores the new upload file.
if OutputFolder =
ExitApp
Loop, parse, files, `n
{
if a_index = 1
Path := A_LoopField
else
{
Currentfile := Path . "\" . A_LoopField
FileRead, atest, %Currentfile%
FileRead, btest, %LookupFile%
OutputFile =
gosub, Exchange ;jump to exchange function
OutFileName := OutputFolder . "\" . A_Loopfield
FileAppend, %OutputFile%, %OutFilename%
}
}
MsgBox, Done
return
Exchange:
loop, parse, atest, `n, `r
{
StringSplit, CurrentField, A_Loopfield ,|
Loop, parse, btest, `n, `r
{
IfInString, A_Loopfield, %CurrentField2%
{
StringSplit, CurrentReplacement, A_Loopfield ,|
CurrentField2 := CurrentReplacement2
break
}
}
loop, %CurrentField0%
CurrentLine .= CurrentField%A_Index% . "|"
OutputFile .= CurrentLine . "`r`n "
CurrentLine =
}
return