Anki add-on: field_extraction_injection

Anki Field Import/Export (Injection/Extraction) This Anki add-on provides a powerful and flexible way to bulk export (extract) specific fields from your Anki notes to a spreadsheet format (TSV) and import (inject) updated data back into them. It is highly customizable, supporting various formatting options, precise ID matching, and a robust undo system. ✨ Features Selective Export/Import: Choose exactly which fields you want to export or update. Format Flexibility: Export and import text as either raw HTML (retaining Anki's formatting) or Plain Text (clean, readable text without HTML tags). Multiple Injection Modes: Update your fields by entirely Replacing the old content, Prepending to it, or Appending to the end of it. Precise Note Matching (NID): Safely update notes regardless of their order by matching them exactly using their unique Note ID ( nid ). Tag Support: Export and import tags alongside your field data. Interactive Safety Net: A built-in review dialog allows you to preview the changes in the Anki browser before permanently applying them, with a one-click Undo button to revert everything if you made a mistake. Excel/Spreadsheet Compatibility: Uses UTF-8-SIG encoding to ensure seamless compatibility with Microsoft Excel and other spreadsheet software without character encoding issues. 🚀 How to Use Accessing the Add-on Open the Anki Browser ( Browse from the main window). Select one or more notes you want to process. In the top menu bar, click on Edit > Field Import/Export Injection/Extraction . Choose whether you want to perform an Extraction (Export) or Injection (Import). 📤 Extraction (Exporting Data) Use this to pull data out of Anki to edit it in Excel, Google Sheets, or a text editor. Select Notes: Highlight the notes in the Anki browser. Launch Extraction: Run the tool and select "Extraction". Select Fields: A dialog will appear asking you to check the specific Anki fields you want to export. Choose Format: Save as HTML: Keeps all formatting tags (e.g., <b> , <div> ). Save as Plain Text: Strips out all HTML tags and converts the content to clean text. NID & Tags Options: * You will be prompted if you want to include the Note ID ( nid ). Highly recommended if you plan to import this data back later. You will be prompted if you want to include the note's tags . Save File: Choose a location to save your .tsv (Tab-Separated Values) file. 📥 Injection (Importing Data) Use this to push edited data from a .tsv file back into your Anki notes. Select Notes: Highlight the target notes in the Anki browser. Launch Injection: Run the tool and select "Injection". Choose Injection Mode: Replace: Overwrites the current field content with the new data. Prepend: Adds the new data to the beginning of the current field content. Append: Adds the new data to the end of the current field content. Choose Import Format: Import as HTML: Reads the TSV data as HTML and renders it (e.g., <b>text</b> becomes bold). Import as Plain Text: Escapes HTML characters (e.g., < becomes &lt; ) so the literal text is shown on the card. Select Target Fields: Choose which fields on the Anki notes are allowed to be modified during this process. Select File: Open your modified .tsv file. NID Matching (Optional but Recommended): * If your TSV file contains an nid column, the add-on will ask if you want to match rows exactly by their Note ID. Yes: Matches precisely. You don't have to worry about the order of notes in the browser. No: Injects data sequentially based on the order of the highlighted notes in the browser. Field Mapping: A dialog will ask you to map the columns from your TSV file to your target Anki fields. You can choose to skip columns you don't want to import. Review & Undo: After the injection runs, a dialog will appear showing how many notes were updated. Do not close this immediately. You can look at the Anki browser in the background to verify the changes. Click Keep Changes to finalize. Click UNDO to instantly revert all modifications made during this session.