ATTENTION: You are viewing a page formatted for mobile devices; to view the full web page, click HERE.

Main Area and Open Discussion > General Software Discussion

Converting Spreadsheet to Table in forum

<< < (6/9) > >>

tomos:
This is really a problem. SED goes through the CSV line by line and I see no way to change this. One possible solution is, that you dont put multiple lines in one cell, but instead use some kind of seperator - # for example - which could be translated to a simple
--- ---[br].
I tried to save the Spreadsheet as HTML, but then you lose the Linebreak. Hmmm... I try to find a solution.
-crono (May 14, 2007, 03:00 PM)
--- End quote ---
didnt really understand till -
only saw the "br" when I quoted you  ;)

sounds like a good idea!

tomos:
Any luck crono  :)

I think if the # idea is feasible it might be the best !?

But I can do that in Text-Editor as well !!  ;)

crono:
Hi Tomos,
I tried to dive into "Openoffice.org XML Export Filter"-Programming. This would be the "cleanest" way to do it, but I haven't found the time right now.
The #-thing would work at least I believe...

Try:

--- ---@echo off
set infile=%1%
sed -e "s/#/\[br\]/g" "%infile%" > temp1.txt
sed -e "s/;/\[\/td\]\[td\]/g" temp1.txt > temp2.txt
sed -e "s/$/\[\/td\]\[\/tr]/g" temp2.txt > temp1.txt
sed -e "s/^/\[tr\]\[td\]/g" temp1.txt > temp2.txt
echo [table] > table.txt
type temp2.txt >> table.txt
echo [/table] >>  table.txt
del temp1.txt
del temp2.txt
Its untested - please try it :)

tomos:
thanks crono
might not be able to try for a couple of days (holiday here tomorrow - moving furniture plans..)
will let you know how i get on (with the script!) when i try it.

David1904:
Hi all,

There is a program called Columnizer (freebie) - from Gulf Coastal Software.
It does a lot of stuff with aligning columns, adding or deleting lines or characters. I really don't know whether it is of any use in this situation or not, but thought I'd mention it

David

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version