Menu

Problem with .csv record greater than 255 characters

2020-03-23
2020-03-23
  • James Sinclair

    James Sinclair - 2020-03-23

    I have a matter in respect to a pcbasic program of which reads a .csv file, of which in turn has data I obtained via the web.

    The fun comes in the form of the fact that one of the columns is mostly over 255 characters in length, and, knowing the best way to read other data in the file despite this fact.

    I use the input# to collect the majority of the data, with an if statement to detect the ones of which are equal to 255 in len(), then, It goes over to a input$(1,1) statement until it reaches either a ", or a ., combo before returning back to the regular input#.

    The issues and questions include,
    + The input$ solution is very slow, there is often a thousand characters to be read in this column. Is there a quicker way.
    + Most of the rows at this location is in quotation marks, but not all. I have no way of knowing, if the opening character is a quotaton mark or not, as this will help if my input$(1,1) needs to terminate on a comma or a quotation mark.

    Is there a solution to this issue?

    Will getting two characters at a time with input$(1,2) be quicker than input$(1,1)?

    The data in this particular column is not important, so is there some way to have the reading jump to the end of the column/data item?

     
  • James Sinclair

    James Sinclair - 2020-03-23

    Just for clarification. The PcBasic program I wrote myself, the .csv file is what I sourced from a website.

     
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.