Skip to content

Malformed CSV when exporting board #7782

@stonebeaver

Description

@stonebeaver

Summary

Users can export a board to a csv file. If the card's description contains markdown close to deck's csv dialect, it is not escaped and parsing the exported csv file becomes ambiguous.

To Reproduce

  1. Enable Deck
  2. Create a board
  3. Scaffold some cards
  4. Type some double quotation marks " in a description field
  5. Export the board as csv
  6. Open the board with (a text editor|LibreOffice Calc|pandas)

Expected behavior

Opening the exported file with LibreOffice Calc shows the board's cards as a table.

import csv
import pandas
board = pandas.read_csv(
    'exported_file_from_nextcloud.csv',
    encoding='utf-16',
    delimiter='\t',
    quotechar='"',
    quoting=csv.QUOTE_ALL,
    header=0,
)

Mitigation/Discussion

Until the exporter is fixed for general users, you can convert the exported csv dialect.

  • The first " of a file is a real delimiter.
  • The last " of a file is a real delimiter.
  • "\t" are real delimiters.
  • "\n" are real delimiters. every other " is a character inside a field.

Although with this mitigation the exported files are not broken beyond repair, the value for general users is quite limited since the exported dialect is outside of the range which is considered as input by general tools. A more compliant export dialect should be considered. I propose LibreOffice Calc and/or pandas as a benchmark.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions