After Import in empty deck via a CSV file which contains svg code, the deck is still empty

After Import in empty deck via a CSV file which contains svg code, the deck is still empty

The csv file is the following form

recto,verso
<img src=“sizing_rect_07_03_00_100_100_4_00_centre.svg”>,<img src=“sizing_rect_07_03_00_100_100_4_00_centre_back.svg”>
<img src=“sizing_rect_07_03_01_100_150_4_00_centre.svg”>,<img src=“sizing_rect_07_03_01_100_150_4_00_centre_back.svg”>

The csv file and the svg files are in UTF8.

If the “Allow HTML in fields” field is set then no card is created. There is no error message.

If the “Allow HTML in fields” field is not set then the cards are created but the characters < and > are replaced by &lt; and &gt;
We obtain the following card.
&lt;img src=“sizing_rect_07_03_00_100_100_4_00_centre.svg”&gt;,&ltimg src=“sizing_rect_07_03_00_100_100_4_00_centre_back.svg”&gt;

I edit by hand in each card and remplace &lt; and &gt; by < and > so that the interpretation of the svg image is carried out.
This is not a very optimized solution.

I have the same problem to editing this topic. if i don’t modify the csv file extract only the character ‘,’ appear.

With your first ansert I correct the formulation of my my topic.

An image tag is <img>, not <image>.

1 Like

I found my syntax error
<img src=“sizing_rect_07_03_00_100_100_4_00_centre.svg”>,
should be
<img src=“sizing_rect_07_03_00_100_100_4_00_centre.svg”/>

Thanks for your hint. Now it works very well.

I deleted the deck. and recreate it, then import with the cvs file corrected this way

<img src=“sizing_rect_07_00_00_100_100_4_00_centre.svg”/>,<img src=“sizing_rect_07_00_00_100_100_4_00_centre_back.svg”/>

the “Allow HTML in fields” field is set.

the detail panel indicates that the cards are in it.
the import is finished without any message.

before using the deck.I look at its content, it is empty.
After restarting Anki the deck is still empty.

Are you putting adding your image files to your collection?

Not sure what you’re referring to.

Does that mean the import is not creating the notes? Or the notes are only creating blank cards? Or the cards aren’t displaying your images?

The import is not creating the notes.

That’s one thing I asked about.

I describe in details what I do.

the home panel is displayed, the name of the deck I want to import is selected.

file/import/

I select the .cvs file

On the panel which appears i see that the button is set.

and the beginning of the file is displayed.

I click on “import”

A panel is displayed indicating the number of notes find in the CSV file.

I clic on the last line (called “détails” in French), more information is displayed.

The cvs file is displayed a table of 4 columns.

the first is an index of line of the table,

the second “state” indicate a possible modification of the corresponding note (updated or not)

the third column shows the line of the cvs file

the fourth column show a magnifying glass on each line of the table.

I click on any of the magnifying glass a new panel is displayed to browse in the note.

The front and the back of the note are well displayed.

The I click on “close” bottom right button.

The home panel is now displayed. The list of the decks is displayed.

I click on the top third button (“parcourir” in French) to browse in the notes of the deck.

And i see there is no notes in it.

Is it possible to put images in the present topic?

Yes, you can add images here – and it might be a good idea for you to.

This is the “Import File” window. What “button” is set? What about the rest of the Import options and Field mapping? Are you setting all of those correctly – for instance, importing into the correct deck?

Anki also tells you the outcome there – what does that say?
image

And what “state” is displayed there?

Have you tried clicking “Show” up above? That will take you to the browser and show you the notes it imported (if any).

Are you looking in the correct deck? Have you searched for what you imported in the Browse / parcourir window to see where it is?

I describe in detail what I do.

the home panel is displayed, the name of the deck I want to import is selected.

file/import/

I select the .cvs file

On the panel which appears i see that the button “Allow HTML in fields” is set.
and the beginning of the file is displayed.

I click on the import button

i click on last line “Détail”


I click on a magnifying glass


then I quit the panel the cross on the top right, Then by clicking on the “close” button the
home panel is displayed and I click on “browse” to browse the deck

The deck has no note.

Okay, there are a number of things going on here.

a. You didn’t ask about this, but Anki is creating a note for this recto/verso row in your CSV. You don’t need column headers in your CSV.
image

b. You’re importing these notes into a deck called sizing_rect_v07_00 – is that what you want?
image

c. My French is a bit rusty, but I’m pretty sure that says no new notes were created, because 1 was already there, and 5 just needed to be updated. (Perhaps that’s because you’ve repeated this with the same file, and the message the first time was that the notes were created?)
image
image

d. That magnifying glass on the import summary page opens the Browse window, and shows you a search of just that one note. In this screenshot you can already see that it’s showing you one of the cards in the sizing_rect_v07_00 deck. The current search at the top of the screen is for the cards made from a specific note.

e. That’s just closing and reopening the Browse window. But when you do, now you can see that the search box is empty. Anki isn’t showing you anything because you haven’t asked for anything. If you want to see the cards in the sizing_rect_v07_00 deck, you can either click that deck in the left sidebar, or you can type deck:sizing_rect_v07_00 in the search filter at the top.
(You can learn more about the features of the Browse window and how to search in the manual – in English or French.)

1 Like

I type deck:sizing_rect_v07_00 in the search filter at the top

Did you click Enter after that?

As I said above, I don’t think your import created any notes/cards. They all already existed in your collection – possibly in some other deck. Maybe search for notes that were created or modified recently, and you’ll find the ones you’re looking for (links about how to Search already posted). Maybe check some of those numerous other decks with nearly the same names.

You have the note ID (nid) of one of the notes in your screenshot above. Maybe that will give you an idea of where the other ones ended up. Or perhaps the notes you imported were created, but they didn’t successfully create any cards (based on the fields that were filled, and your card templates)? Decks can only hold cards not notes, so that’s another reason why searching by deck might turn up empty.