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

<< < (4/9) > >>

tomos:
If you wanted to do it straight from Excel then the following code should work without too many issues. To use it you just have to copy and paste it into your Excel Code Editor in a new Module. The Procedure formats a string and puts it onto the Clipboard:

.........

When I worked at in University we ran a Java based Wiki, and I did many other similar macros to convert from other Office documents to its markup.-Perry Mowbray (May 14, 2007, 01:44 AM)
--- End quote ---

thanks Perry!

I'm afraid I don't have Excel myself,
but sure that will be of use to others

tom

EDIT or could it work in Open Office too ??

Perry Mowbray:
thanks Perry!

I'm afraid I don't have Excel myself,
but sure that will be of use to others
-tomos (May 14, 2007, 01:53 AM)
--- End quote ---

Ah, sorry: I just assumed :-[

EDIT or could it work in Open Office too ??
--- End quote ---

I've not done an OO macro, but it doesn't use VBA does it? The principles would be the same, just a different language would be my guess.

- Perry

tomos:
Keep it simple - this sounds like a job for sed (download it from the gnuwin32 Project). You can run a Batch file with some sed commands to replace text and convert your CSV

The Batch file

.....

bye
-crono (May 13, 2007, 10:09 PM)
--- End quote ---

Okay,

I tried this -
without success I'm afraid but I suspect it may be to do with my csv file.
The final table.txt just has

--- ---[table]
[/table]
I notice your demo input has ";" as separator and no inverted commas "" to delimit text.
So I made a csv file like that (Open Office)
but
I notice my csv file has varying amounts of separators -
sometimes three at the end of of a line, sometimes just one

any ideas there ?
thanks!!
tom
-

PS -
or maybe I should have rebooted after installing sed ?
or maybe I have to have batch file somewhere special ?

tomos:
I should qualify the last post by saying that I'm not very knowledgeable about what goes on "under the hood" in a soft or hardware sense

so
its well possible I'm just doing (or maybe not doing) something silly (or sensible as the case may be  :) )

I'll go before i tie myself up in verbal knots here ...

crono:
Sounds like your SED is not found. To make sure, open a command prompt ([Windows]+[R] -> cmd). Type "sed" - if you got something like "command not found", you have 2 options:

1) Change the path in your Batchfile to "C:/Program Files/YOUR_PATH_TO_SED/sed.exe"
or
2) Add SED to your path, so it is available everywhere. How to: http://www.computerhope.com/issues/ch000549.htm

after this, it should work correctly.

I notice my csv file has varying amounts of separators -
sometimes three at the end of of a line, sometimes just one

--- End quote ---
Hmmm... Sorry - must be a problem with OOo. Maybe there are some Blanks in the cells?

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version