CSV-filteralternativer

CSV-filteret godtar en alternativstreng som inneholder fem til tretten token, atskilt med komma. Token 6 til 13 er valgfrie.

Eksempel:

Importer fra UTF-8, sprÄk tysk, kommaseparert, tekstskilletegn ", sitert felt som tekst. CSV-filen har kolonner formatert som dato, tall, tall, tall:

soffice --infilter="Text - txt - csv (StarCalc):44,34,76,1,1/5/2/1/3/1/4/1,1031,true,true" test.csv

Eksporter til Windows-1252, Feltskilletegn: komma, Tekstskilletegn: sitat, Lagre celleinnhold som vist:

soffice --convert-to "Text - txt - csv (StarCalc):44,34,ANSI,1,,0,false,true,true" --outdir=/home/user test.ods

Tokenposisjon

Definisjon

Betydning og eksempel pÄ token

1

Feltseparator

Feltseparator(er) som ASCII-verdier. Flere verdier er atskilt med skrÄstrektegnet ("/"), det vil si at hvis verdiene er atskilt med semikolon og horisontale tabulatorer, vil token vÊre 59/9. For Ä behandle flere pÄfÞlgende separatorer som én, legg deretter til '/MRG' til tokenet. Hvis filen inneholder felt med fast bredde, bruk 'FIX'. Eksempel: 44 (,)

2

Tekstavgrensning

Tekstskilletegnet som ASCII-verdi, det vil si 34 for doble anfĂžrselstegn og 39 for enkle anfĂžrselstegn. Eksempel: 34 (").

3

Tegnsett

Tegnsettkoden som brukes i filen som beskrevet i tabellen nedenfor. Eksempel: 0 (System).

4

Antall fĂžrste rader

Radnummer for Ă„ begynne Ă„ lese fra. Eksempel: 3 (start fra tredje rad).

5

Celleformatkoder for hver kolonne

En sekvens av kolonne/formateringskode, der formateringskoden er angitt i tabellen nedenfor. Eksempel: "1/5/2/1/3/1/4/1".

Hvis verdiseparatorer brukes, er formen pÄ dette symbolet, kolonne/format[/kolonne/format/...] der kolonne er nummeret til kolonnen, med 1 som kolonnen lengst til venstre. Formatkoden er detaljert beskrevet nedenfor.

Hvis det fÞrste symbolet er FIX, har det formen start/format[/start/format/...], der start er nummeret pÄ det fÞrste tegnet for dette feltet, med 0 som tegnet lengst til venstre pÄ en linje. Formatet er forklart nedenfor.

6

SprÄkidentifikator

Streng uttrykt i desimalnotasjon. Dette tokenet tilsvarer "SprÄk"-listeboksen i brukergrensesnittet for CSV-import. Hvis verdien er 0 eller utelatt, brukes sprÄkidentifikatoren til brukergrensesnittet. SprÄkidentifikatoren er basert pÄ Microsofts sprÄkidentifikatorer.

7

CSV Import, CSV Eksport

Streng, enten falsk eller sann. Standardverdi: falsk. Dette tokenet tilsvarer avkrysningsboksen "Sitert felt som tekst".

8

CSV Import, CSV Eksport

Importer: Streng, enten falsk eller sann. Standardverdi: falsk. Dette tokenet tilsvarer avmerkingsboksen "Oppdag spesialnumre".

Eksporter: Streng, enten usann eller sann. Standardverdi: sann. Dette tokenet har ingen UI-ekvivalent. Hvis sant, lagres tallcellene som tall. Hvis usann, lagres tallene som tekst, med tekstskilletegn.

9

CSV Eksport

Streng, enten usann eller sann. Standardverdi:sann. Dette tokenet tilsvarer avmerkingsboksen "Lagre celleinnhold som vist".

10

CSV Eksport

String, either false or true. Default value: false. Export cell formulas.

11

CSV Import

String, either false or true. Default value: false. Remove spaces. Trim leading and trailing spaces, when reading the file.

12

CSV Export

Export the entire document to individual sheets .csv files or a specified sheet.

  • 0 or absent means the default behaviour, first sheet from command line, or current sheet in macro filter options, exported to sample.csv

  • -1 for all sheets, each sheet is exported to an individual file of the base file name concatenated with the sheet name, for example sample-Sheet1.csv, sample-Sheet2.csv and sample-Sheet3.csv

  • N export the N-th sheet within the range of number of sheets. Example: to export the second sheet, set 2 here to get sample-Sheet2.csv

13

CSV Import

String, either false or true. Default value: false. Determines whether formula expressions starting with a = equal sign character are to be evaluated as formulas or imported as textual data. If true evaluate formulas on input. If false formulas are input as text. If omitted (not present at all), the default value is true to keep the behaviour of old versions' options string that didn't have this token at all. If present and empty (or any other value than true) the default value is false.


Special case of CSV files with separator defined in the first line

CSV import and export support a sep= and "sep=" field separator setting. When reading a CSV document, the separator is taken from the initial sep= or "sep=" single field, if that is the only line content.

When reading a CSV file, the quoted form is preserved as (unquoted) cell content. You see sep=| when | is the separator in the first line. In the unquoted form, the separator is discarded because it is a real field separator in the context. You see sep= in the first line.

When writing a CSV file, the existing single top left cell's content such as sep=| is adapted to the current separator with the quoted form of "sep=|" (if quotes / text delimiters aren't set empty and | is the separator) and always uses the ASCII " double quote character.

If the line containing the sep=| is not to be imported as data, remember to set the From row number in the dialog to 2. Note that this line will not be preserved when re-saving.

Eksempel:


        sep=|
        "LETTER"|"ANIMAL"
        "a"|"aardvark"
        "b"|"bear"
        "c"|"cow"
    

Formatting Codes for Token 5

Meaning

Code

Standard

1

Text

2

MM/DD/YY

3

DD/MM/YY

4

YY/MM/DD

5

-

6

-

7

-

8

Ignore field (do not import)

9

US-English

10


Character Set Codes for Token 3

Character set

Index

Unknown

0

Windows-1252/WinLatin 1 (Western)

1

Apple Macintosh (Western)

2

DOS/OS2-437/US (Western)

3

DOS/OS2-850/International (Western)

4

DOS/OS2-860/Portuguese (Western)

5

DOS/OS2-861/Icelandic (Western)

6

DOS/OS2-863/Canadian-French (Western)

7

DOS/OS2-865/Nordic (Western)

8

System default

9

Symbol

10

ASCII/US (Western)

11

ISO-8859-1 (Western)

12

ISO-8859-2 (Central European)

13

ISO-8859-3 (Latin 3)

14

ISO-8859-4 (Baltic)

15

ISO-8859-5 (Cyrillic)

16

ISO-8859-6 (Arabic)

17

ISO-8859-7 (Greek)

18

ISO-8859-8 (Hebrew)

19

ISO-8859-9 (Turkish)

20

ISO-8859-14 (Western)

21

ISO-8859-15/EURO (Western)

22

DOS/OS2-737 (Greek)

23

DOS/OS2-775 (Baltic)

24

DOS/OS2-852 (Central European)

25

DOS/OS2-855 (Cyrillic)

26

DOS/OS2-857 (Turkish)

27

DOS/OS2-862 (Hebrew)

28

DOS/OS2-864 (Arabic)

29

DOS/OS2-866/Russian (Cyrillic)

30

DOS/OS2-869/Modern (Greek)

31

DOS/Windows-874 (Thai)

32

Windows-1250/WinLatin 2 (Central European)

33

Windows-1251 (Cyrillic)

34

Windows-1253 (Greek)

35

Windows-1254 (Turkish)

36

Windows-1255 (Hebrew)

37

Windows-1256 (Arabic)

38

Windows-1257 (Baltic)

39

Windows-1258 (Vietnamese)

40

Apple Macintosh (Arabic)

41

Apple Macintosh (Central European)

42

Apple Macintosh/Croatian (Central European)

43

Apple Macintosh (Cyrillic)

44

Not supported: Apple Macintosh (Devanagari)

45

Not supported: Apple Macintosh (Farsi)

46

Apple Macintosh (Greek)

47

Not supported: Apple Macintosh (Gujarati)

48

Not supported: Apple Macintosh (Gurmukhi)

49

Apple Macintosh (Hebrew)

50

Apple Macintosh/Icelandic (Western)

51

Apple Macintosh/Romanian (Central European)

52

Apple Macintosh (Thai)

53

Apple Macintosh (Turkish)

54

Apple Macintosh/Ukrainian (Cyrillic)

55

Apple Macintosh (Chinese Simplified)

56

Apple Macintosh (Chinese Traditional)

57

Apple Macintosh (Japanese)

58

Apple Macintosh (Korean)

59

Windows-932 (Japanese)

60

Windows-936 (Chinese Simplified)

61

Windows-Wansung-949 (Korean)

62

Windows-950 (Chinese Traditional)

63

Shift-JIS (Japanese)

64

GB-2312 (Chinese Simplified)

65

GBT-12345 (Chinese Traditional)

66

GBK/GB-2312-80 (Chinese Simplified)

67

BIG5 (Chinese Traditional)

68

EUC-JP (Japanese)

69

EUC-CN (Chinese Simplified)

70

EUC-TW (Chinese Traditional)

71

ISO-2022-JP (Japanese)

72

ISO-2022-CN (Chinese Simplified)

73

KOI8-R (Cyrillic)

74

Unicode (UTF-7)

75

Unicode (UTF-8)

76

ISO-8859-10 (Central European)

77

ISO-8859-13 (Central European)

78

EUC-KR (Korean)

79

ISO-2022-KR (Korean)

80

JIS 0201 (Japanese)

81

JIS 0208 (Japanese)

82

JIS 0212 (Japanese)

83

Windows-Johab-1361 (Korean)

84

GB-18030 (Chinese Simplified)

85

BIG5-HKSCS (Chinese Traditional)

86

TIS 620 (Thai)

87

KOI8-U (Cyrillic)

88

ISCII Devanagari (Indian)

89

Unicode (Java's modified UTF-8)

90

Adobe Standard

91

Adobe Symbol

92

PT 154 (Windows Cyrillic Asian codepage developed in ParaType)

93

Unicode UCS4

65534

Unicode UCS2

65535