R RichardHirst Member Licensed User Longtime User Apr 28, 2015 #1 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
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
Erel B4X founder Staff member Licensed User Longtime User Apr 28, 2015 #2 You can use StringUtils.LoadCSV to read CSV files. If you want to read a string file then use File.ReadString or ReadList. Upvote 0
You can use StringUtils.LoadCSV to read CSV files. If you want to read a string file then use File.ReadString or ReadList.
R RichardHirst Member Licensed User Longtime User Apr 28, 2015 #3 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 Upvote 0
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
Erel B4X founder Staff member Licensed User Longtime User Apr 28, 2015 #4 There is no TextReader in B4i (due to technical reasons). How large is the file? Upvote 0
R RichardHirst Member Licensed User Longtime User Apr 29, 2015 #5 The file has over 5000 lines.. I Could read the complete file into a List and step through the list. Upvote 0
Erel B4X founder Staff member Licensed User Longtime User Apr 29, 2015 #6 I think that this is the best option (and it will be fast). Upvote 0
KY Leng Member Licensed User Longtime User Apr 19, 2016 #7 Erel said: You can use StringUtils.LoadCSV to read CSV files. If you want to read a string file then use File.ReadString or ReadList. Click to expand... How can StringUtils.LoadCSV read the Unicode CSV ? Upvote 0
Erel said: You can use StringUtils.LoadCSV to read CSV files. If you want to read a string file then use File.ReadString or ReadList. Click to expand... How can StringUtils.LoadCSV read the Unicode CSV ?
Erel B4X founder Staff member Licensed User Longtime User Apr 20, 2016 #8 Please start a new thread for this question. Upvote 0