DEV Community

OOOOO
OOOOO

Posted on

How to convert CSV to ASCII table (beautiful plain-text table in code)

Highly recommended a online tools: Convert CSV to ASCII Table

It is my favorite conversion tool designed for table format, and it can convert csv into different friendly plain text tables:

1, ASCII table (mysql style)



+─────────────+─────────+───────────────────+
| 2012-05-02  | palani  | My first comment  |
+─────────────+─────────+───────────────────+
| 2012-05-02  | raja    | My second comment |
+─────────────+─────────+───────────────────+
| 2012-05-02  | palani  | My third comment  |
+─────────────+─────────+───────────────────+
| 2012-05-03  | raja    | My fourth comment |
+─────────────+─────────+───────────────────+


Enter fullscreen mode Exit fullscreen mode

2, reStructuredText Grid table



+-------------+---------+-------------------+
| 2012-05-02  | palani  | My first comment  |
+=============+=========+===================+
| 2012-05-02  | raja    | My second comment |
+-------------+---------+-------------------+
| 2012-05-02  | palani  | My third comment  |
+-------------+---------+-------------------+
| 2012-05-03  | raja    | My fourth comment |
+-------------+---------+-------------------+


Enter fullscreen mode Exit fullscreen mode

3, Unicode table (single line)



┌─────────────┬─────────┬───────────────────┐
| 2012-05-02  | palani  | My first comment  |
├─────────────┼─────────┼───────────────────┤
| 2012-05-02  | raja    | My second comment |
| 2012-05-02  | palani  | My third comment  |
| 2012-05-03  | raja    | My fourth comment |
└─────────────┴─────────┴───────────────────┘


Enter fullscreen mode Exit fullscreen mode

4, Unicode table



╔═════════════╦═════════╦═══════════════════╗
║ 2012-05-02  ║ palani  ║ My first comment  ║
╠═════════════╬═════════╬═══════════════════╣
║ 2012-05-02  ║ raja    ║ My second comment ║
║ 2012-05-02  ║ palani  ║ My third comment  ║
║ 2012-05-03  ║ raja    ║ My fourth comment ║
╚═════════════╩═════════╩═══════════════════╝


Enter fullscreen mode Exit fullscreen mode

And some other formats of plain text ASCII Table. You can also type "Force separate lines" to decide whether to express the title clearly!

Image description

Top comments (0)