Hello.
I have added a "masking"-function, which I have found inside
csv-library.
I recommend using whole library.
Code: Select all
G_List =
(
6/22/2018 WH10301963618201892082 22764 PERROTTA, WHITNEY 5903 PERROTTA, PETER
6/22/2018 EL4151986617201892082 22763 VANDERVALK, ELIZABETH 13003 -
6/22/2018 AD9211997618201892082 22762 VU, ADAM 13002 VU, HUNG
)
Loop, parse, G_List, `n, `r
{
Stringsplit, New_List, A_LoopField, %A_Tab%
fileappend, % Format4CSV(New_List1) "," Format4CSV(New_List2) "," Format4CSV(New_List3) "," Format4CSV(New_List4) "," Format4CSV(New_List5) "," Format4CSV(New_List6) "," Format4CSV(New_List7) "`n", %A_ScriptDir%\new.csv
}
msgbox done
return
; Format4CSV by Rhys
; HTTP://WWW.AUTOHOTKEY.COM/FORUM/TOPIC27233.HTML
Format4CSV(F4C_String)
{
Reformat:=False ;Assume String is OK
IfInString, F4C_String,`n ;Check for linefeeds
Reformat:=True ;String must be bracketed by double quotes
IfInString, F4C_String,`r ;Check for linefeeds
Reformat:=True
IfInString, F4C_String,`, ;Check for commas
Reformat:=True
IfInString, F4C_String, `" ;Check for double quotes
{ Reformat:=True
StringReplace, F4C_String, F4C_String, `",`"`", All ;The original double quotes need to be double double quotes
}
If (Reformat)
F4C_String=`"%F4C_String%`" ;If needed, bracket the string in double quotes
Return, F4C_String
}