# Import problem ("deck" field is ignored since version 24.11)

**URL:** <https://forums.ankiweb.net/t/import-problem-deck-field-is-ignored-since-version-24-11/54405>\
**Category:** Help\
**Created:** [January 15, 2025, 9:36am UTC](https://forums.ankiweb.net/t/import-problem-deck-field-is-ignored-since-version-24-11/54405 "2025-01-15T09:36:42Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![RaZoR](https://avatars.discourse-cdn.com/v4/letter/r/5e9695/32.png) [@RaZoR](https://forums.ankiweb.net/u/RaZoR)\
**Post date:** [January 15, 2025, 9:36am UTC](https://forums.ankiweb.net/t/import-problem-deck-field-is-ignored-since-version-24-11/54405/1 "2025-01-15T09:36:42Z")

</div>

Hello.

I’m using Anki to maintain several different decks with my private English words and phrases collection.

Usually, I do import my files using command line, for instance:

Command line: anki deck\_2025.txt

This file starts with:

```auto
#notetype:Basic
#deck:"2025"
...

```

So, the deck to import cards from this file is specified in the file.

It should work according to documentation and actually it worked successfully before update to 24.11

In 24.11 this “deck” field in txt file is ignored and Anki offers to import file to the desk I’ve selected manually at previous run.

I’ve downgraded version to 24.06.3 and now it works again.

Screenshots:

24.06.3 (correct deck “2025” is automatically selected):

 ![ok](https://us1.discourse-cdn.com/flex002/uploads/anki2/original/3X/2/c/2c1dff5336bd8132f6b83e9b2a44fb38486b50a3.jpeg)

24.11 (wrong deck “abc” is selected…):

 ![bug](https://us1.discourse-cdn.com/flex002/uploads/anki2/original/3X/d/e/de5aa3d24b7315ba991a42a73f0d32b15045641f.jpeg)

---

<div class="post-metadata">

**Author:** ![abdo](https://sea2.discourse-cdn.com/flex002/user_avatar/forums.ankiweb.net/abdo/32/654_2.png) [@abdo](https://forums.ankiweb.net/u/abdo)\
**Post date:** [January 15, 2025, 11:29am UTC](https://forums.ankiweb.net/t/import-problem-deck-field-is-ignored-since-version-24-11/54405/2 "2025-01-15T11:29:52Z")

</div>

Can you share a sample file? I tried this:

```auto
#notetype:Basic
#deck:"2025"
a,b

```

~~The “2025” is not being selected, so I can reproduce the issue (even in 24.06.3)~~ (turned out the deck needs to be created first), but just want to test with your file to find the source of that “abc” deck.

---

<div class="post-metadata">

**Author:** ![RaZoR](https://avatars.discourse-cdn.com/v4/letter/r/5e9695/32.png) [@RaZoR](https://forums.ankiweb.net/u/RaZoR)\
**Post date:** [January 15, 2025, 11:45am UTC](https://forums.ankiweb.net/t/import-problem-deck-field-is-ignored-since-version-24-11/54405/3 "2025-01-15T11:45:56Z")

</div>

Surely, both decks (2025 and abc) are created beforehand.  
Acutally, my decks are already filled with hundreds of cards.

Both files are in the same format:

```auto
#notetype:Basic
#deck:"abc"
a;b

```

```auto
#notetype:Basic
#deck:"2025"
aa;bb

```

anki-24.06.3 = OK  
anki-24.11 = ignores `deck:` field in import files

---

<div class="post-metadata">

**Author:** ![abdo](https://sea2.discourse-cdn.com/flex002/user_avatar/forums.ankiweb.net/abdo/32/654_2.png) [@abdo](https://forums.ankiweb.net/u/abdo)\
**Post date:** [January 15, 2025, 11:55am UTC](https://forums.ankiweb.net/t/import-problem-deck-field-is-ignored-since-version-24-11/54405/4 "2025-01-15T11:55:54Z")

</div>

Anki 24.11 started allowing quotation marks in deck/tag names (see [Do not strip quotation marks from deck/tag names by abdnh · Pull Request #3407 · ankitects/anki · GitHub](https://github.com/ankitects/anki/pull/3407)), so `"abc"` and `"2025"` are interpreted literally now (the quotes were silently stripped in older versions). You can fix the issue by removing the quotes from the deck field.

---

<div class="post-metadata">

**Author:** ![RaZoR](https://avatars.discourse-cdn.com/v4/letter/r/5e9695/32.png) [@RaZoR](https://forums.ankiweb.net/u/RaZoR)\
**Post date:** [January 15, 2025, 12:28pm UTC](https://forums.ankiweb.net/t/import-problem-deck-field-is-ignored-since-version-24-11/54405/5 "2025-01-15T12:28:50Z")

</div>

I’ve already tried `deck:2025` without quotes. The same resultant: anki ignores the field and tries to import cards to another deck.

```auto
#notetype:Basic
#deck:2025
a;b

```

$ anki deck\_2025.txt

Wrong “abc” is selected:

 ![ab](https://us1.discourse-cdn.com/flex002/uploads/anki2/original/3X/b/4/b43bc0e93256e78c20320aebc250b289720dc812.jpeg)

---

<div class="post-metadata">

**Author:** ![abdo](https://sea2.discourse-cdn.com/flex002/user_avatar/forums.ankiweb.net/abdo/32/654_2.png) [@abdo](https://forums.ankiweb.net/u/abdo)\
**Post date:** [January 15, 2025, 4:43pm UTC](https://forums.ankiweb.net/t/import-problem-deck-field-is-ignored-since-version-24-11/54405/6 "2025-01-15T16:43:25Z")

</div>

Looks like there’s a separate issue here with `2025`: Anki is actually interpreting the year as a deck ID and is defaulting to a different deck when no deck with such ID is found.

---

<div class="post-metadata">

**Author:** ![abdo](https://sea2.discourse-cdn.com/flex002/user_avatar/forums.ankiweb.net/abdo/32/654_2.png) [@abdo](https://forums.ankiweb.net/u/abdo)\
**Post date:** [January 15, 2025, 4:45pm UTC](https://forums.ankiweb.net/t/import-problem-deck-field-is-ignored-since-version-24-11/54405/7 "2025-01-15T16:45:14Z")

</div>

> [@abdo](#):
>
> (turned out the deck needs to be created first)

Sidenote: The manual is misleading on this point: [Text Files - Anki Manual](https://docs.ankiweb.net/importing/text-files.html#deck-column)

---

<div class="post-metadata">

**Author:** ![RaZoR](https://avatars.discourse-cdn.com/v4/letter/r/5e9695/32.png) [@RaZoR](https://forums.ankiweb.net/u/RaZoR)\
**Post date:** [January 15, 2025, 7:39pm UTC](https://forums.ankiweb.net/t/import-problem-deck-field-is-ignored-since-version-24-11/54405/8 "2025-01-15T19:39:11Z")

</div>

I could say that manual is correct:

`"deck" Deck name or id Presets the deck, if it exists.`

(Note that `deck` and `deck column` are different keywords)

And yes! You are right - if I load deck\_abc.txt, the `abc` is treated as deck `Name`, but in the problematic file, `2025` is treated as `Id`, not `Name`.

Any ideas how to deal with it without renaming my decks to `^[^0-9]*` ?

It would be good to add a special condition such as `toString().equals(deckName) || toInt().equals(deckId)` (pseudo code).

---

<div class="post-metadata">

**Author:** ![dae](https://sea2.discourse-cdn.com/flex002/user_avatar/forums.ankiweb.net/dae/32/65_2.png) [@dae](https://forums.ankiweb.net/u/dae)\
**Post date:** [January 18, 2025, 6:43am UTC](https://forums.ankiweb.net/t/import-problem-deck-field-is-ignored-since-version-24-11/54405/9 "2025-01-18T06:43:09Z")

</div>

@Rumo I seem to recall this has come up before - do we have an existing issue about it or stance on it? I did a quick search but couldn’t find one.

---

<div class="post-metadata">

**Author:** ![Rumo](https://sea2.discourse-cdn.com/flex002/user_avatar/forums.ankiweb.net/rumo/32/1505_2.png) [@Rumo](https://forums.ankiweb.net/u/Rumo)\
**Post date:** [January 19, 2025, 9:43am UTC](https://forums.ankiweb.net/t/import-problem-deck-field-is-ignored-since-version-24-11/54405/10 "2025-01-19T09:43:00Z")

</div>

Not aware of it.  
Seems reasonable to check if a passed number is an existing deck name, but if I recall correctly, it will require some restructuring of the code.

---

<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:** [January 19, 2025, 11:24am UTC](https://forums.ankiweb.net/t/import-problem-deck-field-is-ignored-since-version-24-11/54405/11 "2025-01-19T11:24:20Z")

</div>

I’ve been working on a pr for this. The approach taken is to enclose numeric deck and notetype\* names in single-quotes (`'`), and escape other existing single-quotes present in non-numeric names with a backslash (`\`)

Problem is the breakage where old clients won’t know how to handle escaped single-quotes in deck/notetype names when trying to import these new CSVs

Thoughts? Or perhaps instead of quoting and escaping, is it preferable to just assume a numeric deck name is not an id if no such deck id exists?

\*this issue also applies to notetype names btw

EDIT: [opened a pr](https://github.com/ankitects/anki/pull/3748)

---

<div class="post-metadata">

**Author:** ![RaZoR](https://avatars.discourse-cdn.com/v4/letter/r/5e9695/32.png) [@RaZoR](https://forums.ankiweb.net/u/RaZoR)\
**Post date:** [January 19, 2025, 12:30pm UTC](https://forums.ankiweb.net/t/import-problem-deck-field-is-ignored-since-version-24-11/54405/12 "2025-01-19T12:30:31Z")

</div>

Hello.

```auto
deck:"2025"
deck:'2025'
deck:2025

```

1. find “as is” `"2025"` in deck names
2. strip quotes, for instance: s/["']//g
3. find stripped `2025` in deck names
4. finally, find `2025` in deck IDs list

The first found result is the targeted deck.

---

<div class="post-metadata">

**Author:** ![sorata](https://sea2.discourse-cdn.com/flex002/user_avatar/forums.ankiweb.net/sorata/32/34115_2.png) [@sorata](https://forums.ankiweb.net/u/sorata)\
**Post date:** [January 19, 2025, 4:06pm UTC](https://forums.ankiweb.net/t/import-problem-deck-field-is-ignored-since-version-24-11/54405/13 "2025-01-19T16:06:14Z")

</div>

I think having these as subsections of “File Header” is an issue. Your link describes “deck column” and not the header that starts with #.

---

<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:** [February 18, 2025, 4:07pm UTC](https://forums.ankiweb.net/t/import-problem-deck-field-is-ignored-since-version-24-11/54405/14 "2025-02-18T16:07:06Z")

</div>

Closed on February 18, 2025, 4:07pm UTC

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