Tables and using notpad++ as go between between google sheets and this forum
SpoilerShow Content
Install notepad++ if you have not already.
open notepad++.
We shall now create the macro to do the magic.
I will be writing in a codebox so that forum ignores the codes i will be using.
important, make it so you can read this post and type in notepad++, as you will need to type exactly what is between the inverted commas below, and not cut and paste, as the macro record wont pick that up.
Copy a table from sheets and paste into a blank notepad++
then click macro->make table
If everything went correct you will have a correctly formatted table with an extra /td /tr at the top after table you can trim off.
[/td][/tr]
now that most of the grunt work is done, you can beauitify it by using th for header
open notepad++.
We shall now create the macro to do the magic.
I will be writing in a codebox so that forum ignores the codes i will be using.
important, make it so you can read this post and type in notepad++, as you will need to type exactly what is between the inverted commas below, and not cut and paste, as the macro record wont pick that up.
Code:
with notepad open at a new blank documnent, click macro->start recording
then press CRTL+HOME (to return us to the start of the file)
type "[table=30]" and press enter
click search->replace...
click extended search mode
in find what type "\t"
in replace type "[/td][td]"
click replace all
in find what type "\n"
in replace type "[/td][/tr]\n[tr][td]"
click replace all
click close
press CRTL+END and type "[/td][/tr][/table]"
click macro->stop recording
click save current recorded macro and name it "make table"
Done....
now to test..
then click macro->make table
If everything went correct you will have a correctly formatted table with an extra /td /tr at the top after table you can trim off.
OrderDate | Region | Rep | Item | Units | UnitCost | Total |
1/6/2020 | East | Jones | Pencil | 95 | 1.99 | 189.05 |
1/23/2020 | Central | Kivell | Binder | 50 | 19.99 | 999.5 |
2/9/2020 | Central | Jardine | Pencil | 36 | 4.99 | 179.64 |
2/26/2020 | Central | Gill | Pen | 27 | 19.99 | 539.73 |
3/15/2020 | West | Sorvino | Pencil | 56 | 2.99 | 167.44 |
4/1/2020 | East | Jones | Binder | 60 | 4.99 | 299.4 |
4/18/2020 | Central | Andrews | Pencil | 75 | 1.99 | 149.25 |
5/5/2020 | Central | Jardine | Pencil | 90 | 4.99 | 449.1 |
5/22/2020 | West | Thompson | Pencil | 32 | 1.99 | 63.68 |
6/8/2020 | East | Jones | Binder | 60 | 8.99 | 539.4 |
6/25/2020 | Central | Morgan | Pencil | 90 | 4.99 | 449.1 |
OrderDate | Region | Rep | Item | Units | UnitCost | Total |
---|---|---|---|---|---|---|
1/6/2020 | East | Jones | Pencil | 95 | 1.99 | 189.05 |
1/23/2020 | Central | Kivell | Binder | 50 | 19.99 | 999.5 |
2/9/2020 | Central | Jardine | Pencil | 36 | 4.99 | 179.64 |
2/26/2020 | Central | Gill | Pen | 27 | 19.99 | 539.73 |
3/15/2020 | West | Sorvino | Pencil | 56 | 2.99 | 167.44 |
4/1/2020 | East | Jones | Binder | 60 | 4.99 | 299.4 |
4/18/2020 | Central | Andrews | Pencil | 75 | 1.99 | 149.25 |
5/5/2020 | Central | Jardine | Pencil | 90 | 4.99 | 449.1 |
5/22/2020 | West | Thompson | Pencil | 32 | 1.99 | 63.68 |
6/8/2020 | East | Jones | Binder | 60 | 8.99 | 539.4 |
6/25/2020 | Central | Morgan | Pencil | 90 | 4.99 | 449.1 |
Code:
to convert from sheets to here:
prepend [table=30]
find replace
\t with [/td][td]
\n with [/td][/tr]\n[tr][td]
append [/td][/tr][/table]