Uwe.S Posted June 8, 2006 Share Posted June 8, 2006 Hi,is it possible to read a Field in a *.csv table ( and thencopy that field to clipboard?Example:C:\test.csvField1;Field2;Field3Msgbox Line 1: this is Field2, copy Field2 to clipboad....do somethingLine 1: this is Field3, copy Field2 to clipboad....do somethingnextLine 2: this is Field3, copy Field2 to clipboad....do somethingI tried many things...and houres$input = FileOpen("c:\test.csv",0)but I don't know how to solve this Problem!THANKS for help Link to comment Share on other sites More sharing options...
BigDod Posted June 8, 2006 Share Posted June 8, 2006 Lookup StrinSplit in the help file. Time you enjoyed wasting is not wasted time ......T.S. Elliot Suspense is worse than disappointment................Robert Burns God help the man who won't help himself, because no-one else will...........My Grandmother Link to comment Share on other sites More sharing options...
Uwe.S Posted June 8, 2006 Author Share Posted June 8, 2006 thank you I had an older Version and this code worked... Loop, Read, FileName.csv, { Loop, Parse, A_LoopReadLine, `; { if A_Index = 3 { Field3 = %A_LoopField% msgbox %Field3% } } } Could you help me with Version 3.1 it is total different! Link to comment Share on other sites More sharing options...
Bert Posted June 8, 2006 Share Posted June 8, 2006 You can use ExcelCOM by Randell to do it. Go here to download it The Vollatran project  My blog: http://www.vollysinterestingshit.com/ Link to comment Share on other sites More sharing options...
Xenobiologist Posted June 8, 2006 Share Posted June 8, 2006 HI, #include <file.au3> #include <GUICONSTANTS.au3> Global $a_cvs $s_Path = FileOpenDialog("Select CVS File", @ScriptDir, "comma seperated values (*.csv)") If @error Then MsgBox(4096, "", "No File(s) chosen") Exit Else _FileReadToArray($s_Path, $a_cvs) GUICreate("CVS Listview", 620, 250, -1, -1) $listview = GUICtrlCreateListView(StringReplace($a_cvs[1],";","|"), 10, 10, 600, 210) GuiSetState() For $i = 2 To UBound($a_cvs) - 1 $s_temp = StringReplace($a_cvs[$i], ";", "|") GUICtrlCreateListViewItem($s_temp, $listview) Next EndIf While 1 $msg = GuiGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop EndSelect WEnd Exit So long, Mega Scripts & functions Organize Includes Let Scite organize the include files Yahtzee The game "Yahtzee" (Kniffel, DiceLion) LoginWrapper Secure scripts by adding a query (authentication) _RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...) Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc. MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times Link to comment Share on other sites More sharing options...
Uwe.S Posted June 8, 2006 Author Share Posted June 8, 2006 thanks you, it is a really big code!!! Is there no other possibility to read the csv fields and do an action? The Problem is take from First line Field 2 copy to clipboard do something... Link to comment Share on other sites More sharing options...
Uwe.S Posted June 8, 2006 Author Share Posted June 8, 2006 Hi,your solution shows the csv table great!But the problem I have is to get field-entries Example:Line 1 Field 1 = FredCopy Fred to Clipboard? If yes then do something....Line 2 Field 2 = ParisHow can I react?I mean ...do something....with Line1 Field2;Field3, Line2 Field2;Field3thanks for helpUwe Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now