# File Headers won't work if .csv was created with LibreOffice Calc

**URL:** <https://forums.ankiweb.net/t/file-headers-wont-work-if-csv-was-created-with-libreoffice-calc/66266>\
**Category:** Help\
**Created:** [September 4, 2025, 3:37pm UTC](https://forums.ankiweb.net/t/file-headers-wont-work-if-csv-was-created-with-libreoffice-calc/66266 "2025-09-04T15:37:54Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Anon\_0000](https://avatars.discourse-cdn.com/v4/letter/a/c67d28/32.png) [@Anon\_0000](https://forums.ankiweb.net/u/Anon_0000)\
**Post date:** [September 4, 2025, 3:37pm UTC](https://forums.ankiweb.net/t/file-headers-wont-work-if-csv-was-created-with-libreoffice-calc/66266/1 "2025-09-04T15:37:54Z")

</div>

This is about [File Headers](https://docs.ankiweb.net/importing/text-files.html#file-headers).

# Expected Behavior

When importing a .csv, while using file headers to denote e.g. notetype, Anki should recognize the file header and apply it accordingly and properly.

Also see the _Workarounds_ chapter below.

# Actual Behavior

Anki doesn’t recognize the file headers if they have been created via LibreOffice Calc, or interprets them incorrectly.

# Steps to Reproduce

1. Create a sample .csv in LibreOffice Calc and save it with field delimiter `,`, String delimiter `"`.  
 ![LO Calc View of the .csv](https://us1.discourse-cdn.com/flex002/uploads/anki2/original/3X/b/a/ba90ff4f18c9b02db0597e675853e2c24bdfbdbb.png)
2. Click Import in Anki.
3. See that the notetype and deck are incorrect (but the field separator is correct):  
 ![Anki Import View](https://us1.discourse-cdn.com/flex002/uploads/anki2/original/3X/f/6/f6f9581f84aa6cd94c985341cf45b8c8cd3e3ee8.png)

# Additional Info

# #1

Anki asks to create a new `Pineapple,,` deck. That is due to the additional fields (Comma separated). Anki doesn’t recognize the actual `Pineapple` deck:

 ![Anki Import View (decks expanded)](https://us1.discourse-cdn.com/flex002/uploads/anki2/original/3X/3/d/3df873a94bb1a14798e7b61f79359f9b607a0ec2.png)

# #2

The generated .csv looks like this:

```auto
#separator:Comma,,
#notetype:Cloze,,
#deck:Pineapple,,
Front,Back,Tags
Hello,World,Tags::Sub_Tags

```

# #3

If the .csv was created with the _Quote all fields_ option checked in LibreOffice, then you get the following generated file:

```auto
"#separator:Comma",,
"#notetype:Cloze",,
"#deck:Pineapple",,
"Front","Back","Tags"
"Hello","World","Tags::Sub_Tags"

```

In this case, the workaround provided below only works, if you remove the `"` from the lines starting with `#`. Also, with this quote option turned on, Anki no longer guesses the separator correctly; it falls back to Colon.

# Workarounds

One could manually modify the .csv outside of LibreOffice like this:

```auto
#separator:Comma,,
#notetype:Cloze
#deck:Pineapple
Front,Back,Tags
Hello,World,Tags::Sub_Tags

```

Though this isn’t user friendly.

# Affected versions

At least the following:

**Current Stable**  
Anki 25.07.5 (7172b2d2) (ao)  
Python 3.13.5 Qt 6.9.1 PyQt 6.9.1  
Platform: Linux-6.12.38+deb13-amd64-x86\_64-with-glibc2.41

**Current Release Candidate**  
Anki 25.09rc1 (5c4d2e87) (ao)  
Python 3.13.5 Qt 6.9.1 PyQt 6.9.1  
Platform: Linux-6.12.19-amd64-x86\_64-with-glibc2.41

# Related

[https://github.com/ankitects/anki/issues/3853](https://github.com/ankitects/anki/issues/3853)

---

<div class="post-metadata">

**Author:** ![Anon\_0000](https://avatars.discourse-cdn.com/v4/letter/a/c67d28/32.png) [@Anon\_0000](https://forums.ankiweb.net/u/Anon_0000)\
**Post date:** [September 4, 2025, 5:00pm UTC](https://forums.ankiweb.net/t/file-headers-wont-work-if-csv-was-created-with-libreoffice-calc/66266/2 "2025-09-04T17:00:34Z")

</div>

@llama

Can we just apply your solution to the following two as well?

> <https://github.com/ankitects/anki/blob/5c4d2e87a14a50601616426881609c4ee5b7b3ae/rslib/src/import_export/text/csv/metadata.rs#L158-L169>

That should solve it as far as I understand\*.

* * *
\* Except for the case where the separator is Colon, as LO Calc will auto quote the metadata field in this case (because it contains a Colon)

---

<div class="post-metadata">

**Author:** ![llama](https://avatars.discourse-cdn.com/v4/letter/l/8baadc/32.png) [@llama](https://forums.ankiweb.net/u/llama)\
**Post date:** [September 4, 2025, 6:59pm UTC](https://forums.ankiweb.net/t/file-headers-wont-work-if-csv-was-created-with-libreoffice-calc/66266/3 "2025-09-04T18:59:37Z")

</div>

This looks identical to [Import of CSV not reading all File Headers in v. 25.07.01 - Anki / Development - Anki Forums](https://forums.ankiweb.net/t/import-of-csv-not-reading-all-file-headers-in-v-25-07-01/63518/16), with the solution proposed by dae there likely to be the one used going forwards

---

<div class="post-metadata">

**Author:** ![Anon\_0000](https://avatars.discourse-cdn.com/v4/letter/a/c67d28/32.png) [@Anon\_0000](https://forums.ankiweb.net/u/Anon_0000)\
**Post date:** [September 4, 2025, 7:39pm UTC](https://forums.ankiweb.net/t/file-headers-wont-work-if-csv-was-created-with-libreoffice-calc/66266/4 "2025-09-04T19:39:32Z")

</div>

Except that that user had a working _deck_ header, which doesn’t work for me either.

No idea how I missed that report though, it indeed is very similar.

---

<div class="post-metadata">

**Author:** ![llama](https://avatars.discourse-cdn.com/v4/letter/l/8baadc/32.png) [@llama](https://forums.ankiweb.net/u/llama)\
**Post date:** [September 4, 2025, 8:12pm UTC](https://forums.ankiweb.net/t/file-headers-wont-work-if-csv-was-created-with-libreoffice-calc/66266/5 "2025-09-04T20:12:24Z")

</div>

> [@Anon\_0000](#):
>
> Except that that user had a working _deck_ header, which doesn’t work for me either.

> [@Import of CSV not reading all File Headers in v. 25.07.01](https://forums.ankiweb.net/t/import-of-csv-not-reading-all-file-headers-in-v-25-07-01/63518/4):
>
> It shouldn’t be. It’s also freeform, i.e. looking for a deck with the name EO All Official Esperanto Words and Roots,,,,,,,, Refer to [Loosen csv metadata parsing by iamllama · Pull Request #3862 · ankitects/anki · GitHub](https://github.com/ankitects/anki/pull/3862#issuecomment-2736367978). The manual should probably be updated with a notice for this, if anyone wants to get on that.

My understanding is that he did not. Why he left that unclarified is 🤷‍♂️

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex002/uploads/anki2/original/1X/8f1279ababc5879d54e4838989f606cfe55af8c7.jpeg) [@system](https://forums.ankiweb.net/u/system)\
**Post date:** [October 4, 2025, 8:12pm UTC](https://forums.ankiweb.net/t/file-headers-wont-work-if-csv-was-created-with-libreoffice-calc/66266/6 "2025-10-04T20:12:46Z")

</div>

Closed on October 4, 2025, 8:12pm UTC

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
