Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 6 of 6
  1. #1
    New to the CF scene
    Join Date
    Oct 2018
    Location
    Ohio
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Basic and comma delimited files

    Is it possible to read comma delimited files using the Basic language? The files in question have over 1,000 fields with data consisting of integers, real numbers, strings and single characters.

  2. #2
    Regular Coder
    Join Date
    Sep 2014
    Posts
    282
    Thanks
    1
    Thanked 50 Times in 48 Posts
    I know of no computer language that does not have file manipulation capability. You'll have to read the file as text, line by line, then split them using comma as delimiter. If you are processing a real csv file, you'll have to add the capability to detect columns that are enclosed by quote.

  3. #3
    New to the CF scene
    Join Date
    Oct 2018
    Location
    Ohio
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by josephm View Post
    You'll have to read the file as text, line by line, ...
    The "lines" in question are thousands of characters long, perhaps as many as 10,000 characters. Can Basic read a line that long? Pascal can't.

  4. #4
    Master Coder sunfighter's Avatar
    Join Date
    Jan 2011
    Location
    Washington
    Posts
    7,866
    Thanks
    36
    Thanked 1,049 Times in 1,045 Posts
    Why not use JavaScript? Every browser in the world has it and Papa Parse ( a program) can handle very large files. Get it put it on your computer and have fun. https://www.papaparse.com
    Evolution - The non-random survival of random variants.
    Physics is actually atoms trying to understand themselves.

  5. #5
    Senior Coder deathshadow's Avatar
    Join Date
    Feb 2016
    Location
    Keene, NH
    Posts
    3,222
    Thanks
    4
    Thanked 470 Times in 458 Posts
    Quote Originally Posted by sunfighter View Post
    Why not use JavaScript?
    Because he's retrocomputing using a 20 year old version of BASIC for fun/education?
    “There are two ways of constructing a software design: One way is to make it so simple that there are obviously no deficiencies and the other way is to make it so complicated that there are no obvious deficiencies.” – C.A.R. Hoare, The 1980 ACM Turing Award Lecture
    http://www.cutcodedown.com

  6. #6
    New to the CF scene
    Join Date
    Oct 2018
    Location
    Ohio
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by deathshadow View Post
    Because he's retrocomputing using a 20 year old version of BASIC for fun/education?
    Close.

    I'm writing a book which is not about programming but programming is an element of it. I wrote the programs in Pascal but I don't think the majority of potential readers know Pascal or would be willing to learn it just to read my book. In discussing the book with some others who just might be interested in reading the book the Basic language comes up again and again. That's the reason for potentially using Basic. One person has mentioned Javascript.

    Data in the form of comma delimited files is a given. They are sold by a company that has been in business for decades and that company is not going to change their format just to accommodate me.

    Right now the project is on hold. More pressing matters have come up.


 

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •