Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9319859
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 19, 20262026-06-19T03:29:19+00:00 2026-06-19T03:29:19+00:00

I have been digging around for this for a while and can’t find a

  • 0

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

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-19T03:29:21+00:00Added an answer on June 19, 2026 at 3:29 am

    You should break the text CSV file into records (single lines) and then break each record into values (separated by commas). You may proceed this way from the point you have the CSV text file into a string (csvLines).

    -- getting records (you don't need to set applescript's text item delimiters here)
    set recs to paragraphs of csvLines
    
    -- getting values for each record
    set vals to {}
    set applescript's text item delimiters to ","
    repeat with i from 1 to length of recs
        set end of vals to text items of (item i of recs)
    end repeat
    
    -- this is true
    (item 1 of vals) = {"1","2","3","a","b","c","4","5","6","d","e","f","7","8","9","0"} 
    

    This will parse the entire file without filtering. But is just to give the idea of correct CSV parsing. You already know how to filter the data.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have been digging around on this site and googling for a while now
Ok, I've been digging around and haven't found an answer to this. I have
I've been digging around everywhere and I can't seem to figure this out. It's
Hello I have been meaning to get around to this for a while now,
Have been digging around the docs but cannot find if there is a function
I've been digging around for a while about this issue. In my layout, I
Can it be done? I've been digging around and haven't found anything as to
I've been doing a lot of digging around and have ended up with a
I've been digging around stack overflow for a solution to maintaining multiple iOS applications
So I've been digging around on the net all afternoon to find the answer

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.