Reading CSV
Posted: Wed Oct 12, 2016 2:14 pm
The code below is the start of me reading in a CSV file, the contents of the file are stored in the variable fileData however I would like to sort it a little more.
The CSV file has 3 collumns, I would like to sort the data in each collum into their own seperate arrays. I was wondering how I could accomplish this.
The CSV file has 3 collumns, I would like to sort the data in each collum into their own seperate arrays. I was wondering how I could accomplish this.
Code: Select all
on readFile
answer file "Choose file..."
if the result is not "Cancel" then
put it into marksFile
end if
put url ("file:" &marksFile) into fileData
//Sort data in the CSV
local lineNo
split fileData by CR
repeat with lineNo = 1 to 50
//Code to sort collumns into variables
end repeat
end readFile