iOS Question Read from Text File as String

Discussion in 'iOS Questions' started by RichardHirst, Apr 28, 2015.

  1. RichardHirst

    RichardHirst Member Licensed User

    Hi.

    Looking to read a line of text as string from a Text / CSV file... does anyone have any hints or examples please...

    Thanks

    Richard
     
  2. Erel

    Erel Administrator Staff Member Licensed User

    You can use StringUtils.LoadCSV to read CSV files.

    If you want to read a string file then use File.ReadString or ReadList.
     
  3. RichardHirst

    RichardHirst Member Licensed User

    The file I have could have many lines so ReadList would have to be very large, so looking to read them one at a time using a timer.

    In B4A I could use the TextReader

    Dim GPSReader As TextReader

    Then read each line one by one..

    NMEA.gps_string = GPSReader.Readline

    Not sure how ReadString can read each line..???

    Is there a ReadLine in B4i

    Thanks

    Richard
     
  4. Erel

    Erel Administrator Staff Member Licensed User

    There is no TextReader in B4i (due to technical reasons). How large is the file?
     
  5. RichardHirst

    RichardHirst Member Licensed User

    The file has over 5000 lines..

    I Could read the complete file into a List and step through the list.
     
  6. Erel

    Erel Administrator Staff Member Licensed User

    I think that this is the best option (and it will be fast).
     
  7. KY Leng

    KY Leng Member Licensed User

    How can StringUtils.LoadCSV read the Unicode CSV ?
     
  8. Erel

    Erel Administrator Staff Member Licensed User

    Please start a new thread for this question.
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice