Please enable JavaScript to view this site.

thinBasic Help Manual

* * HELP & MANUAL PREMIUM PACK 4 DEMO VERSION * *

This documentation was styled with a demo skin from the Premium Pack 4 add-on for Help & Manual. The contents of the skin are encrypted and not configurable. You can only publish HM projects with this skin. You cannot edit it or change it.

This version is copyright and may only be used for local testing purposes. It may not be distributed.

Please purchase the full version of the Premium Pack to get the configurable skins and remove this notice. The package will also include the Toolbox configuration utility for Premium Pack skins.

 

Description

 

Parses CSV file with user specified delimiter.

 

Syntax

 

nCols = <CCSV>.Load(sFileName [, FirstLineIsHeader [, sCharDelim]])

 

Returns

 

Number, number of columns found.

-1 = fail

 

Parameters

 

Name

Type

Optional

Meaning

sFileName

String

No

Full CSV file path name

FirstLineIsHeader

Number

Yes

If TRUE, first line will be interpreted as line containing column names. Default value is FALSE

sCharDelim

String

Yes

Single character considered CSV field delimiter.

 

Default filed delimiter is comma (,)

 

Default field delimiter can also be set/get by <cCSV>.Char.Delim property.

 

Remarks

 

If all will be fine, Load method will create a <cCSV>.Data(nRow, nCol) matrix

 

Restrictions

 

See also

 

Examples

 

uses "CSV"

 

Dim MyCSV As New CCSV

 

' Default loading, presuming no header and comma as separator

MyCSV.Load(APP_ScriptPath + "Sample-Spreadsheet-10000-rows.csv")

 

' Presuming comma as separator, but specifying first line is header

MyCSV.Load(APP_ScriptPath + "Sample-Spreadsheet-10000-rows.csv"true)
 

' Explicitly stating first line is a header and overriding default separator to semicolon

MyCSV.Load(APP_ScriptPath + "Sample-Spreadsheet-10000-rows.csv"true";")

 

 

Created with Help+Manual 8 and styled with Premium Pack Version 4 © by EC Software