In this article, the topic of Symbolic Link (SYLK) will be addressed, which has gained great relevance in recent years. Symbolic Link (SYLK) is a topic that has aroused the interest of experts and the general public, due to its impact on different areas of society. Throughout this article, different aspects related to Symbolic Link (SYLK) will be explored, from its origin to its evolution today. The impact that Symbolic Link (SYLK) has had in various sectors will be analyzed, as well as the future perspectives that are envisioned around this topic. In addition, different positions and perspectives of experts in the field will be presented, with the aim of providing a broad and complete vision of Symbolic Link (SYLK).
Filename extension |
.slk |
---|---|
Internet media type | application/x-sylk |
Developed by | Microsoft |
Symbolic Link (SYLK) is a Microsoft file format typically used to exchange data between applications, specifically spreadsheets. SYLK files conventionally have a .slk
suffix. Composed of only displayable ANSI characters, it can be easily created and processed by other applications, such as databases.
Microsoft has never published a SYLK specification. Variants of the format are supported by Multiplan, Microsoft Excel, Microsoft Works, OpenOffice.org, LibreOffice and Gnumeric. The format was introduced in the 1980s and has not evolved since 1986.
A commonly encountered (and spurious) 'occurrence' of the SYLK file happens when a comma-separated value (CSV) format is saved with an unquoted first field name of 'ID', that is the first two characters match the first two characters of the SYLK file format. Microsoft Excel (at least to Office 2016) will then emit misleading error messages relating to the format of the file, such as "The file you are trying to open, 'x.csv', is in a different format than specified by the file extension...".
SYLK is known to cause security issues, as it allows an attacker to run arbitrary code, offers the opportunity to disguise the attack vector under the benign-looking appearance of a CSV file, and is still enabled by default on recent (2016) versions of Microsoft Excel.
SYLK does not have support for Unicode. Even if a SYLK file is created by an application that supports Unicode (for example Microsoft Excel), the SYLK file will be encoded in the current system's ANSI code page, not in Unicode. If the application contained characters that were displayable in Unicode but have no code point in the current system's code page, they will be converted to question marks ('?') in the SYLK file.
The semicolon is treated as a field separator in SYLK, so cannot be used unescaped in data values. If a character string in the SYLK file is to contain a semicolon (;) then it should be prefixed with another semicolon so the string would appear as e.g., "WIDGET;;AXC1254". MS Excel will strip the first semicolon on import and the data element will appear as "WIDGET;AXC1254".
Each line of a SYLK input file must be no longer than 260 characters. Otherwise, Microsoft Excel will issue an error message and skip loading the overlong line.
As an example, the following SYLK code in a text file with the .slk extension:
ID;P C;Y1;X1;K"Row 1" C;Y2;X1;K"Row 2" C;Y3;X1;K"Total" C;Y1;X2;K11 C;Y2;X2;K22 C;Y3;X2;K33 E
would be displayed like this when read by an appropriate spreadsheet:
Row 1 | 11 |
Row 2 | 22 |
Total | 33 |
The formatting of 2 decimal digits is applied to Column 2 using
F;P2;C2
where P0 is for General, P1 is for no decimal, P2 is for 2 digits, P3 has leading $ sign with 2 decimal points as defined below.
ID;P P;PGeneral P;P_(* #,##0_);;_(* \-#,##0_);;_(* "-"_);;_(@_) P;P_(* #,##0.00_);;_(* \(#,##0.00\);;_(* "-"??_);;_(@_) P;P_("$"* #,##0.00_);;_("$"* \(#,##0.00\);;_("$"* "-"??_);;_(@_) C;Y1;X1;K"Row 1" C;Y2;X1;K"Row 2" C;Y3;X1;K"Total" C;Y1;X2;K11 C;Y2;X2;K22 C;Y3;X2;K0;ER1C2+R2C2 F;P2;C2 E
would be displayed like this when read by an appropriate spreadsheet:
Row 1 | 11.00 |
Row 2 | 22.00 |
Total | 33.00 |
F;W⟨n1⟩⟨n2⟩⟨n3⟩
defines the widths of a group of columns:
For example: Adding these SYLK codes will adjust the column width of column 1 and 2 to 20 and 30 respectively.
F;W1 1 20 F;W2 2 30
F;⟨cl⟩⟨n⟩⟨c2⟩
For example: The following SYLK code demonstrates the cell formatting properties:
ID;P P;PGeneral C;Y1;X1;K"Row 1 Left Justify" F;P0;FG0L C;Y2;X1;K"Row 2 Right Justify" F;P0;FG0R C;Y3;X1;K"Total at Center" F;P0;FG0C C;Y1;X2;K11 C;Y2;X2;K22 C;Y3;X2;K0;ER1C2+R2C2 F;Y1;X2;FF2L F;Y2;X2;FF2R F;Y3;X2;F$2C F;W1 2 25 E
SYLK_file ::= Record + Record ::= RecordType Field* newline
Date and time are stored as a floating point value. The whole number part is a number of days from the Jan 1 1900 (if the O record contains the ;V0 directive, specifying 1900 as the starting point for calculations), the fraction is the number of seconds divided by 86400 (60*60*24, number of seconds in a day). Conversion to unix time can be done by subtracting the difference between Jan 1 1970 and Jan 1 1900 (25,569 days) and then multiplying by 86400; converting from unix time to SYLK datetime is done by dividing the value by 86400 and then adding 25569. The cell style has to be set to some date formatting value, e.g. P;Pdd/mm/yyyy\ hh:mm:ss
to be displayed properly.
.slk file exports opened with Excel have a limit of 255 characters in a cell. This limit is not present in LibreOffice.
Syntax for SYLK can be found at:
and at:
Limits related to reading and saving with Excel: