However, the carriage returns are causing it to be shown as 5 lines.
How can I show the data as 2 rows, by either ignoring the carriage returns, or something else?
Code: Select all
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
#SingleInstance force
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
F1 = ExampleText.csv
/* EXAMPLE OF TEXT IN CSV WHEN OPENED IN NOTEPAD
"Retain comma, between double quotes","Retain carriage return
between double quotes"
This has no comma between double quotes,This has no carriage returns between double quotes
"Retain carriage return
between double quotes","Retain comma, between double quotes"
*/
Gui, Add, ListView, grid x15 yp+35 hp+280 w605 -LV0x10 vMyList, Column1|Column2|ID
Gui, Show
GoSub, ShowInList
return
ShowInList:
GuiControl, -Redraw, MyList
LV_Delete()
;THIS CODE DEALS WITH TEXT ENCLOSED BETWEEN " " WERE IT INCLUDES A COMMA
Loop Read, % F1
{
arr := []
Loop Parse, A_LoopReadLine, CSV
arr.Push(A_LoopField)
LV_Add("", arr[1],arr[2],A_Index)
}
;BUT HOW DO i DEAL WITH CARRIAGE RETURNS, WHICH ARE MESSING UP THE LISTVIEW DISPLAY?
LV_ModifyCol(1,"280")
LV_ModifyCol(2,"280")
LV_ModifyCol(3,"30 Integer")
GuiControl, 1:+Redraw, MyList
return
GuiClose:
Exitapp