<< Click to Display Table of Contents >>

Navigation:  ThinBASIC Modules >





CSV module add functionalists for reading RFC 4180 CSV delimited files.


How to use this module


Inside your script, before calling any module specific keyword, add the following:






A moderate performance, low memory, modified RFC 4180 CSV delimited file reader.


Module will skip blank lines

it allows for a remark character which is the pound symbol (#) by default.

You can change the delimiter. The delimiter defaults to a comma (,) but can be changed to a tab or any other character.


It fully supports any characters embedded inside the quotes including carriage returns and line feeds.

A double quote can be embedded by including two double quote. ("") i.e. "This ""is"" a test" when read, it will return This "is" a test.


Note that ColumnNames, delimiter character, and remark character can only be changed before the CSV reader is opened.


If a file does not have column headers, you can assign column names if you want. If you don't the columns will be labeled c1, c2, c3 etc.


Tests with CSV files of up to 2M rows and up to 100K columns


Additional information



Important notes about CSV module


1. CSV thinBasic module is based on by Larry Charlton sources with some modifications
Library can be found at the following link: http://www.cur-ion.net/delimited.html
Additional info can be found here: https://forum.powerbasic.com/forum/user-to-user-discussions/source-code/55698-rfc-4180-csv-delimited-file-reader