Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

Inhalte einer .csv in Listview


  • Please log in to reply
3 replies to this topic
ultimate23
  • Members
  • 7 posts
  • Last active: Apr 28 2016 06:57 AM
  • Joined: 11 Jun 2015

Hallo Zusammen,

 

ich habe folgende Herausforderung. Ich habe eine .csv-Datei welche ca. 300 Zeilen und 4 Spalten hat. Ich möchte die Inhalte gerne in einer Listview in 4 Spalten anzeigen lassen. Wie mach ich das? Hab gefühlt schon alles ausprobiert und bekomm es leider nicht hin :(

 

Danke im Voraus!



space
  • Members
  • 520 posts
  • Last active:
  • Joined: 12 Aug 2014
ready made programs are https://github.com/JnLlnd/CSVBuddy and http://autohotkey.co...-you-type/ they use these libraries https://github.com/JnLlnd/ObjCSV and http://autohotkey.co...sv-library-lib/ can read a CSV and show the result in listview.

garry
  • Spam Officer
  • 3219 posts
  • Last active: Sep 20 2018 02:47 PM
  • Joined: 19 Apr 2005

small example to read 4 columns

SetWorkingDir %A_ScriptDir%
f1=%a_scriptdir%\test11.csv
;fileread,aa,%f1%
ifnotexist,%f1%
{
aa=
(LTrim Join`r`n
aa1,bb1,cc1,dd1
aa2,bb2,cc2,dd2
aaaaa3,bbbb3,ccc3,d3
aa4,bb4,cc4,dd4
aa5,bb5,cc5,dd5
)
fileappend,%aa%,%f1%
}
Gui, add, listview, gA1 vLV1, A|B|C|D
Loop, Read,%f1%
  {
  StringSplit,c, A_LoopReadLine, `,
  LV_Add("",c1,c2,c3,c4)
  }
LV_ModifyCol()
Gui, show, AutoSize Center, AHK_EXAMPLE_CSV
Return
Guiclose:
exitapp

A1:
; doubleclick on row
GuiControlGet,LV1
cw:= LV_GetNext(0, "F")
LV_GetText(D1,cw,1)
LV_GetText(D2,cw,2)
LV_GetText(D3,cw,3)
LV_GetText(D4,cw,4)
msgbox, 262208,CSV_RESULT ,A=%d1%`nB=%d2%`nC=%d3%`nD=%d4%
Return
;========================================================



Blightbuster
  • Members
  • 10 posts
  • Last active: Dec 18 2015 01:09 PM
  • Joined: 20 Apr 2015

s