Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get reasonably formated text tables out of excel for use as plain text or Markdown [closed]

Tags:

text

format

excel

I had the following situation:

Spreadsheet used to calculate pricing for a bunch of different kinds of trees. (I'm a tree farmer)

This data has two uses:

  1. I use it in Markdown to make tables on my web page.
  2. I use it in kijiji ads.

The latter made things sticky. Cut and paste from excel leaves data separated by single tabs. Nothing lines up. A pasted table in excel in some program like Kijiji looks like this:

|   Bareroot Bundles of 25 2-3 year olds                            ||||
|   Bundles |   # Trees |   Cost    |   Price Per Tree  |
|:  -------------   :|: ------- :|: ------- :|: ------------------- :|
|   5 Trees |   5   |   $30.00  |   $6.00   |
|   Single Bundle   |   25  |   $75.00  |   $3.00   |
|   5 Bundles   |   125 |   $300.00 |   $2.40   |
|   10 Bundles  |   250 |   $525.00 |   $2.10   |

Yuck.

like image 937
Sherwood Botsford Avatar asked Feb 02 '14 16:02

Sherwood Botsford


1 Answers

If I have a table like this:

enter image description here

I would do it with the following steps:

  1. Add the header separators from a new row using a bunch of -, making sure that there is more than than less:

    enter image description here

  2. Insert additional columns to contain the column separators, then select the cells that will have the separators. Insert the separator and then, instead of pressing Enter, I would press Ctrl+Enter to fill all the selected cells at the same time:

    enter image description here

  3. Format everything to the font Courier New, adjust the alignments and column widths:

    enter image description here

  4. Save as Formatted Text:

    enter image description here

This will look like this if you open the file in notepad:

enter image description here

like image 126
Jerry Avatar answered Oct 05 '22 08:10

Jerry