Convert NBIB to CSV

What converting a PubMed NBIB citation file to CSV changes, what can be lost, and when to keep the original tagged file instead.

An NBIB file is the citation export PubMed produces for reference managers. It holds records in the MEDLINE tagged text format. Converting it to CSV turns those records into rows and columns that a spreadsheet, database or script can read. This review covers what that conversion actually changes, where meaning can be lost, and when the original file is the better thing to keep or share.

Short verdict

Converting NBIB to CSV is a good fit if you want to sort, filter, deduplicate, count or screen citations in a spreadsheet or analysis tool. The main benefit is a tabular view: one row per article and one column per field. The main tradeoff is that the MEDLINE format allows repeated and multi-line fields, and a flat table does not. Authors, affiliations, MeSH headings and publication types must be merged into one cell, spread across numbered columns, or moved into separate rows. Each choice affects later use. Keep the original NBIB, or use a format a reference manager can import, if you need to re-import the citations, build a bibliography, or archive the records without loss.

What the conversion actually changes

This is a change of structure, not of characters. A correct conversion keeps the text of every value it carries over. Nothing is reversed, restyled or swapped for look-alike Unicode characters. What changes is how the values are arranged and marked off.

In the MEDLINE tagged format, each line starts with a field tag of up to four characters, padded with spaces, followed by a hyphen and a space. The value comes after that. A long value continues on following lines that are indented with spaces and carry no tag. A blank line separates one record from the next. Many tags can appear more than once in a record, such as one AU line per author or one MH line per MeSH heading.

A converter has to do four things. It splits the file into records. It joins continuation lines back onto the value they belong to. It maps each tag to a column. It decides how to handle repeated tags. The output then has to follow CSV quoting conventions: a value that contains a comma, a double quote or a line break goes inside double quotes, and any double quote inside the value is written twice.

The example below is illustrative. The values are placeholders and do not describe a real PubMed record. It shows a wrapped title, two authors (one with an accented letter), and a MeSH heading that contains a comma.

PMID- 99999999
TI  - An illustrative title that is long enough to wrap onto a
      second line in the export
AU  - Smith J
AU  - García L
DP  - 2020 Mar
MH  - Humans
MH  - Example Term, Secondary

In one reasonable CSV form, the wrapped title becomes a single line, the repeated AU and MH values are joined with a semicolon and a space, and the cells that contain commas are quoted:

PMID,TI,AU,DP,MH
99999999,"An illustrative title that is long enough to wrap onto a second line in the export","Smith J; García L",2020 Mar,"Humans; Example Term, Secondary"

This output matches the mechanism described above. The text of each value is unchanged, the accented character is kept, and only the layout and delimiters differ. It is still one design choice among several. The joining delimiter has no meaning in the MEDLINE format itself, so a later reader cannot tell whether a semicolon separates two values or belongs inside one. Affiliation text in particular can contain semicolons. If that ambiguity matters, use a delimiter that does not occur in your data, or use a long layout with one row per record and value.

Ways to handle repeated fields

Approach | What it looks like | Good for | Drawback
Join into one cell | Authors in one cell, separated by a chosen delimiter | Screening and reading in a spreadsheet | Delimiter can clash with the content; splitting it back out is fragile
Numbered columns | AU_1, AU_2, AU_3 and so on | Fixed-width analysis of first or last authors | Many sparse columns; the column count depends on the longest record
Long format | One row per PMID, tag and value | Scripts, databases, counting MeSH terms | Harder to read by eye; needs reshaping for a one-row-per-article view
Keep selected fields only | Only PMID, title, journal and date, for example | Simple lists and quick sharing | Dropped fields cannot be recovered from the CSV

Points to check before relying on the output

  • Record count: the number of data rows should equal the number of records in the NBIB file (count the PMID lines).
  • Continuation lines: long titles, abstracts and affiliations should come through whole, not cut off at the first line.
  • Repeated tags: every author and heading should be present, not just the first or last one.
  • Encoding: author names and other text with accented or non-Latin characters should survive. Save and open the CSV as UTF-8. Some spreadsheet programs guess the encoding of a CSV file and can show these characters garbled unless the file is imported with the encoding set explicitly.
  • Automatic type conversion: spreadsheet programs may reformat values that look like dates or numbers when they open a CSV. Gene symbols, date strings and identifiers are all at risk. Importing those columns as text avoids this.
  • Fields you care about: check that the converter keeps the fields you need, such as abstract, DOI, MeSH headings or publication type. Converters differ in what they carry over.

Will the result stay usable after copying or sharing?

CSV is plain text, so the converted citations stay searchable and editable, and they copy cleanly between programs that understand the format. Reading order is not a concern in the way it is for visually styled text. Each value is stored as ordinary characters in the order written. In a spreadsheet, a reader or assistive technology moves through it cell by cell. Very long cells, such as full abstracts or joined affiliation lists, can make that slow to navigate. A reduced CSV with only the needed columns is often easier to read and to share.

Pasting rows into an email, document or chat window usually removes the table structure, or turns it into tab-separated text, depending on the destination. If the people receiving the data need a readable list rather than a dataset, a formatted bibliography or a short plain-text list of citations is the better choice. This review did not test specific spreadsheet programs, destinations or screen readers. Confirm behaviour in the tools your readers actually use rather than assuming one successful rendering applies everywhere.

When to keep the NBIB file or another citation format

Reference managers import MEDLINE-format files directly, but they generally do not rebuild complete citation records from an arbitrary CSV. If the next step is citing, building a library or sharing citations with collaborators who use a reference manager, keep or send the NBIB file, or export to a format their software imports. Keep the original too whenever the CSV dropped fields or merged repeated values. Turning the CSV back into tagged records cannot reliably restore what the flattening removed.

Routes to a CSV and what to weigh

If you still have access to the PubMed search, its save options include a CSV format. That export holds a summary set of columns rather than every MEDLINE field, so check whether it includes what you need, such as abstracts or MeSH headings, before choosing it over converting the NBIB file. Another route is to import the NBIB file into a reference manager that can export CSV. The columns then follow that program's own field model, not the MEDLINE tags. A short script gives full control over continuation lines, repeated tags and quoting, which suits repeatable workflows. Online converters are another route. No evidence was available on how any particular converter handles the data or what it keeps, so read a service's stated policies rather than judging from its appearance. A citation list can reveal an unpublished research focus, so consider that before uploading one.

Evidence gaps

No specific converter was tested for this review, and no measurements, accuracy rates or compatibility results are reported. The format details above are general features of the MEDLINE tagged format and of common CSV conventions. Whether a given tool handles continuation lines, repeated tags, encoding and quoting correctly has to be checked with your own file, using the checklist above.