FlexCel Studio for VCL/LCL
ContentsIndex
PreviousUpNext
TFlexCelImport.SaveAsText Method

Saves the file as Text.

Pascal
procedure SaveAsText(const FileName: TFileName; const Delimiter: UTF16Char);
C++
__fastcall SaveAsText(const TFileName FileName, const UTF16Char Delimiter);
Parameters 
Description 
const FileName: TFileName 
File to Open. 
const Delimiter: UTF16Char 
The character used to separate fields. 

If you need more control on what to save, for example to save only a range, you should use the SaveRangeAsTextDelim global method (on unit UTextDelim). 

 

When saving a string that contains the delimiter, it will automatically quote the string, by adding the character " at the beginning and at the end of it. If the string contains a Quote character (") , it will be doubled.

To save a CSV file (Comma Separated Values):

SaveAsText('Filename', ',' );

 

To save a CSV file (Comma Separated Values) using ";" instead of "," to separate the fields:

//This is the way CSV is saved on countries where the "," and not the "." is the decimal separator.
SaveAsText('Filename', ';' );

 

To save a Tab Delimited file:

SaveAsText('Filename', #9 );
Copyright (c) 2002-2008 TMS Software. All rights reserved.
What do you think about this topic? Send feedback!