polaski Posted March 19, 2019 Share Posted March 19, 2019 (edited) #include <Array.au3> #include <File.au3> Global $opis = "Read from CSV" #Region Global $zawartosc_CSV _FileReadToArray(@ScriptDir & "\" & "Tablica przypisania.csv",$zawartosc_CSV,Default,";") if $zawartosc_CSV == 0 Then MsgBox($MB_SYSTEMMODAL, "Error!", "Can`t find file: 'Tablica przypisania.csv'") EndIf ;_ArrayDisplay($zawartosc_CSV) ;Wyświetlanie zawartości tablicy. #EndRegion ConsoleWrite($zawartosc_CSV[6][1] & @CRLF) if StringInStr($zawartosc_CSV[6][1],",") Then $zawartosc_CSV[6][1] = StringSplit($zawartosc_CSV[6][1],",",$STR_NOCOUNT) EndIf ConsoleWrite("After Split: " & $zawartosc_CSV[6][1][0] & @CRLF) _ArrayDisplay($zawartosc_CSV[6][1]) Here is an example CSV (txt) Nazwa Operacji;Rodzaj zasobu;Dotyczy;Zasób;stawka;Send dodatkowy kontrola jakości(QJ);Gniazdo Produkcyjne,Jednostki robocze;Zasób,Kompetencja;Hala Kontroli Jakości,-;2,12;!2{TAB}{TAB}{TAB}{TAB}{F3}k{TAB}{TAB}t!z Malowanie;Gniazdo Produkcyjne;Zasób;Hala Map 99;2; Pakowanie i Kontrola Jakości;Gniazdo Produkcyjne,Jednostki robocze;Zasób,Kompetencja;Hala Kontroli Jakości,-;2,12;!2{TAB}{TAB}{TAB}{TAB}{F3}k{TAB}{TAB}t!z Zgrzewanie;Gniazdo Produkcyjne;Zasób;Hala Map 99;2; Żłobienie;Gniazdo Produkcyjne;Zasób;Hala Map 99;2; I read file into Array and then i need to split element of array into array. The problem starts when i need to acces into that array --> ConsoleWrite("After Split: " & $zawartosc_CSV[6][1][0] & @CRLF) How to get to element by address Edited March 19, 2019 by polaski Link to comment Share on other sites More sharing options...
polaski Posted March 19, 2019 Author Share Posted March 19, 2019 ConsoleWrite("After Split: " & _ArrayToString($zawartosc_CSV[6][1]) & @CRLF) <-- Works ConsoleWrite("After Split: " & $zawartosc_CSV[6][1][0] & @CRLF) <-- Wont work 😕 Link to comment Share on other sites More sharing options...
FrancescoDiMuro Posted March 19, 2019 Share Posted March 19, 2019 @polaski You need to hold the split in another array, so, create a new variable and hold that information in it polaski 1 Click here to see my signature: Spoiler ALWAYS GOOD TO READ: Forum Rules Forum Etiquette Link to comment Share on other sites More sharing options...
polaski Posted March 20, 2019 Author Share Posted March 20, 2019 Thanks for suggestion. That solve my problem I was trying to replace string with array of strings in array of strings. I was hoping that will work like tuple. I dont know why it dosn't work like that 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