I have been digging around for this for a while and can't find a solution. I have a CSV with for example the following data:
1,2,3,a,b,c,4,5,6,d,e,f,7,8,9,0
0,9,8,g,h,i,7,6,4,k,l,m,5,4,3,2
etc...
Each line contains mostly different data except for certain fields that are either true or false.
What i need is to pull each line as a list to then be able to parse the data.
I want to be able to remove, for example item number 3 from all the lists and then save the data to be used in a spreadsheet.
Please keep in mind I am relatively new to applescript so still trying to get my fingers on it, have bought a book that seems highly recommended on numerous sites but it's not delivered yet! :-)
Also if you know a different/better way of doing this then I would be happy to try.
At the moment I have the following:
Blockquote -- Setting Variables
set LF to ASCII character 10
-- Choosing your files
set prompt1 to "Please locate your Devices CSV file..."
set csvDevices to "testfile.csv"
--set csvDevices to (choose file with prompt prompt1)
-- Reading file to memory
set csvLines to read csvDevices
set AppleScript's text item delimiters to {LF}
set csvEntries to paragraphs of csvLines
set AppleScript's text item delimiters to {","}
-- Filtering rubbish
set csvNoTitle to rest of csvEntries -- Remove Title Line
set lineCount to count csvNoTitle
after that I am able to print out the contents but it will give me
{"1,2,3,a,b,c,4,5,6,d,e,f,7,8,9,0","0,9,8,g,h,i,7,6,4,k,l,m,5,4,3,2","etc..."}
rather than what I would like
{"1","2","3","a","b","c","4","5","6","d","e","f","7","8","9","0"}
{"0","9","8","g","h","i","7","6","4","k","l","m","5","4","3","2"}
{"etc..."}
by the way I remove the first line in the script as it's a description line with no actual useful data, or not to me anyway.
Thanks for any help