Spread 8.0 Documentation
Example
Support Options

Glossary Item Box

Example


The following example loads a tab-delimited file (tabbed.txt) into the first Spread sheet, and then loads a file that uses user-defined column and row delimiters (delimiters.txt).

The tab-delimited file (tabbed. txt) has the following format:

Place[tab]Swim[tab]Bike[tab]Run
First[tab]12:20[tab]38:47[tab]17:12
Second[tab]12:40[tab]39:55[tab]18:01

The file with defined column and row delimiters (delimiters.txt) has the following format:

Place,Swim,Bike,Run
First,12:20,38:47,17:12
Second,12:40,39:55,18:01

To access the file used in this sample, change the path in the code to the path for your product installation's \SAMPLES\FILES directory.

C++

// Load tab-delimited file
ret = m_Spread1.LoadTextFile("C:\Samples\Files\tabbed.txt", "", "\t", "\n", LoadTextFileColHeaders|LoadTextFileRowHeaders, "");

// Load file using column and row delimiters.
ret = m_Spread1.LoadTextFile("C:\Samples\Files\delimiters.txt", "", ",", "\n", LoadTextFileColHeaders|LoadTextFileRowHeaders, "");

Visual Basic

' Load tab-delimited file
ret = fpSpread1.LoadTextFile("C:\Samples\Files\tabbed.txt", "", Chr(9), Chr(10), LoadTextFileColHeaders Or LoadTextFileRowHeaders, "")

' Load file using column and row delimiters.
ret = fpSpread1.LoadTextFile("C:\Samples\Files\delimiters.txt", "", ",", Chr(10), LoadTextFileColHeaders Or LoadTextFileRowHeaders, "")

© 2002-2014 ComponentOne, a division of GrapeCity. All Rights Reserved.