Sign in Join
Wiki copytemporary

SDF

English · Français

SDF is a delimited text file format used in Delphi (and later FreePascal) that is very much like, but not the same, as CSV. (.sdf is also the extension of Microsoft SQL Server data files, therefore it may not be a good idea to use the .sdf extension for your files).

SDF format

A summary of the SDF format as used in TStringList, as paraphrased/synthesized from various versions of Delphi help (e.g. DelimitedText, StrictDelimiter)

Example output

Example SDF output (tested in Delphi and FPC after applying the patch for issue 19610):

Note: FPC versions below 2.6.0 do not generate SDF according to the specification

This series of strings in a stringlist (note: numbers in front indicate the field for clarity, they are not part of the data):

0normal_string
1includes;delimiter
2includes space
3includes"quote
4includes "quote and space
5tab   character
6"single_starting_quote
7multi
line.
8   SpacesInFront
9SpacesAtTheEnd

gets output as this with StrictDelimiter true (and ; as delimiter):

normal_string;"includes;delimiter";includes space;"includes""quote";"includes ""quote and space";tab   character;"""single_starting_quote";multi
line.;   SpacesInFront;SpacesAtTheEnd  

... and output as this with StrictDelimiter false:

normal_string;"includes;delimiter";"includes space";"includes""quote";"includes ""quote and space";"tab    character";"""single_starting_quote";"multi
line.";"   SpacesInFront";"SpacesAtTheEnd  "

See also


From the Free Pascal wiki, page "SDF", as it stood on 2017-06-14 after a change by E-ric, out of the wiki's dump of 2024-05-26. Copyright stays with the author who wrote it, according to the old wiki's Licensing page. If you have concerns about this material, message the admin.

Revision 1, last changed by WikiArchive .

Talk about this page

Nobody has opened a bench for this page yet. Sign in to open one.