Welcome Guest.   Make a donation to an author on the site April 23, 2014, 01:20:34 PM  *

Please login or register.
Or did you miss your validation email?


Login with username and password (forgot your password?)
Why not become a lifetime supporting member of the site with a one-time donation of any amount? Your donation entitles you to a ton of additional benefits, including access to exclusive discounts and downloads, the ability to enter monthly free software drawings, and a single non-expiring license key for all of our programs.


You must sign up here before you can post and access some areas of the site. Registration is totally free and confidential.
 
The N.A.N.Y. Challenge 2012! Download dozens of custom programs!
   
   Forum Home   Thread Marks Chat! Downloads Search Login Register  
Pages: Prev 1 [2]   Go Down
  Reply  |  New Topic  |  Print  
Author Topic: Converting Spreadsheet to Table in forum  (Read 16105 times)
tomos
Charter Member
***
Posts: 8,067



see users location on a map View Profile WWW Give some DonationCredits to this forum member
« Reply #25 on: May 15, 2007, 02:36:47 AM »

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
.
I tried to save the Spreadsheet as HTML, but then you lose the Linebreak. Hmmm... I try to find a solution.
didnt really understand till -
only saw the "br" when I quoted you  Wink

sounds like a good idea!
Logged

Tom
tomos
Charter Member
***
Posts: 8,067



see users location on a map View Profile WWW Give some DonationCredits to this forum member
« Reply #26 on: May 16, 2007, 01:35:29 PM »

Any luck crono  smiley

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

But I can do that in Text-Editor as well !!  Wink
Logged

Tom
crono
Charter Honorary Member
***
Posts: 178


see users location on a map View Profile Give some DonationCredits to this forum member
« Reply #27 on: May 16, 2007, 02:39:50 PM »

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:
[copy or print]
@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 smiley
Logged
tomos
Charter Member
***
Posts: 8,067



see users location on a map View Profile WWW Give some DonationCredits to this forum member
« Reply #28 on: May 16, 2007, 04:45:37 PM »

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.
Logged

Tom
David1904
Supporting Member
**
Posts: 39

see users location on a map View Profile Give some DonationCredits to this forum member
« Reply #29 on: May 16, 2007, 05:03:01 PM »

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
Logged
tomos
Charter Member
***
Posts: 8,067



see users location on a map View Profile WWW Give some DonationCredits to this forum member
« Reply #30 on: May 21, 2007, 03:40:00 AM »

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:
[copy or print]
@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 smiley

Now [finally smiley ] tested  -

4cat140.zip.exehttp://files.chatnfiles.careware%203/026/files.htm
DOS Cataloger
Freeware

from this .csv file (using "#" as separator to indicate new line within a cell) 
[copy or print]
4cat140.zip.exe;http://files.chatnfiles.careware%203/026/files.htm#DOS Cataloger;Freeware;;

looks very good to me
Crono  Thmbsup thanks again!
- will try it with the full list spreadsheet sometime (soon) this week and post a link here when done  thumbs up
Logged

Tom
tomos
Charter Member
***
Posts: 8,067



see users location on a map View Profile WWW Give some DonationCredits to this forum member
« Reply #31 on: May 21, 2007, 03:46:23 AM »

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

Hi David,
thanks for that

I couldnt find a home page for that -
could you tell us a bit more about it or give a link ?

I did find the programme for download here -
http://www.simtel.net/pro...l_fb_product_page%5D91922

thanks
tom
Logged

Tom
David1904
Supporting Member
**
Posts: 39

see users location on a map View Profile Give some DonationCredits to this forum member
« Reply #32 on: May 21, 2007, 06:57:45 AM »

Hi Tom,

Can't help you much sorry. I hunted for Gulf Coastal for a while - but without success.
I just remembered that a while back I found the program somewhere and tracked it back to the Gulf Coastal site - but that was a year or two back.
I've not really used it (just thought - that must be useful for something one day - and downloaded it)
So if you have it and have looked at it - you will know as much as I do (maybe more cheesy)

David
Logged
AbteriX
Charter Honorary Member
***
Posts: 1,021


Member #520

see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #33 on: May 22, 2007, 02:01:42 AM »

That's a very interesting thread to me.

WOW David thank you for this info about Columnizer, i find this tool really handy.

Some Info's about Columnizer:

Columnizer 5.38
Gulf Coastal Software  ---  Note: This program is no longer supported.
Columnizer is a special program for working with column and  row data.
Found by: David1904
Download: columnzr.zip ~650kB

DL possibility: http://www.simtel.net/pro...l_fb_product_page%5D91922
Note you get there an "download-columnzr.zip.exe", start this to download the columnzr.zip ~650kB
(need to find an better DL)

Install: run the Setup.exe or just unpack the Setup.exe with UNIExtract

Size: Columnizer.exe ~ 1MB (300kB geUPXt) that is in total not many more then ~300kB

Stand alone?: Seams to be stand alone, uses an ini and text files to store the setings



Logged

Greetings, Stefan.
AbteriX
Charter Honorary Member
***
Posts: 1,021


Member #520

see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #34 on: May 22, 2007, 05:59:23 AM »

Thank you all for the inspiration.
I have "rigging up" an script for >PSPad< to do this.
Just select some comma separated text in PSPad and execute this script.

Look in the script for  Const mySEPARATOR = ","
and modify the comma to an char your CSV is separated, if you need this.
(  Or improve this script with something like mySEPARATOR = InputBox("Separator:",,",") )



For the other way around, export a web side table (e.g. to Excel) there is Table2Clipboard, an FireFox extension:
https://addons.mozilla.org/de/firefox/addon/1852

« Last Edit: July 31, 2007, 03:17:41 PM by AbteriX » Logged

Greetings, Stefan.
brett
Charter Member
***
Posts: 125



Australia

see users location on a map View Profile Give some DonationCredits to this forum member
« Reply #35 on: May 22, 2007, 09:06:02 AM »

How about CSVed
http://csved.sjfrancke.nl/index.html

All the power you will ever need to manipulate a CSV file.
The help file is limited, so sometimes you need to explore and learn.

Load a CSV file into the app,   pay attn to the 'Set Separator' and refresh

You can modify/replace/search/prefix/suffix etc , its all there, plenty of power under the hood.
or even better....
File > Export fast > to html  (view or file),  smiley

HTML of 'Demo Input' from previous post (export fast)

Brett
Logged
AbteriX
Charter Honorary Member
***
Posts: 1,021


Member #520

see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #36 on: May 22, 2007, 09:51:17 AM »

Thank you brett for reminding me to CSVed.

Note, our solutions do this:
Did you read that the intention was
to create BB code formated table
for to input e.g. here in the forum ?

from this text:
Quote
Did you read that the intention was
to create BB code formated table
for to input e.g. here in the forum ?


Can CSVed this too ?

---
Edit:
upps, i had used no separator in my example ... nice too ;-)
« Last Edit: May 22, 2007, 09:55:56 AM by AbteriX » Logged

Greetings, Stefan.
tomos
Charter Member
***
Posts: 8,067



see users location on a map View Profile WWW Give some DonationCredits to this forum member
« Reply #37 on: May 25, 2007, 08:31:01 AM »

See post Number 2
in this thread for a list of 213 (or is it 214  smiley ) created by Crush
and facilitated by Crono's convert from spreadsheet to Forum Table batch file

Please post any opinions !!

follow the link to post#2 in quote above to see the final (successful) conversion of .csv file to forum table

- takes a bit of work though to get the multi-line cells.
(especially when there's over a hundered of them tongue )
If others want to use this it's possible limiting the width of the columns [edit: if that's possible] would be an easier way to go?

thanks again to crono & everyone else who chipped in  thumbs up  smiley
tom
Logged

Tom
tomos
Charter Member
***
Posts: 8,067



see users location on a map View Profile WWW Give some DonationCredits to this forum member
« Reply #38 on: March 01, 2009, 11:10:55 AM »

hi Crono smiley

I'm trying to update that disc catalogue list, I've changed computers so I've freshly installed sed
I saved your code (below) as  Convert.bat
I'm attempting - unsuccessfully so far - to convert a csv file via drag-drop (I removed spaces from csv file name - that was initially a problem last time)
Separater is comma

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've tried option two above without success (I still get "'sed' is not recognised" when I try via command line)
In Option #1 you say "Change the path.."
eh ... what path (please remember I'm no coder nor even a power(ful) user for that matter Wink )
[copy or print]
@echo off
set infile=%1%
sed -e "s/;/\[\/td\]\[td\]/g" "%infile%" > temp1.txt
sed -e "s/$/\[\/td\]\[\/tr]/g" temp1.txt > temp2.txt
sed -e "s/^/\[tr\]\[td\]/g" temp2.txt > temp1.txt
echo [table] > table.txt
type temp1.txt >> table.txt
echo [/table] >>  table.txt
del temp1.txt
del temp2.txt

I've restarted and double checked/tried everything again but no luck

The only thing that does happen is if I right click Convert.bat and click open, it then creates a table.txt file with just
[table][/table]
as content

EDIT/ I tried replacing %1% in the batch file with the sed.exe path but that didnt work either
FORGOT TO SAY:
Windows XP SP2 up-to-date

EDIT2/ the sed file I downloaded was sed-4.1.5-setup.exe (the "Complete package, except sources") from
http://gnuwin32.sourceforge.net/packages/sed.htm
« Last Edit: March 01, 2009, 11:55:20 AM by tomos » Logged

Tom
crono
Charter Honorary Member
***
Posts: 178


see users location on a map View Profile Give some DonationCredits to this forum member
« Reply #39 on: March 02, 2009, 06:55:42 PM »

Hi Tomos,

in which folder have you installed your sed.exe? Lets assume it is in "C:\Program Files\Gnu\Sed\", than you should change the bat-file like this to ensure your sed.exe is found (this is what I meant by "change the path"):
[copy or print]
@echo off
set infile=%1%
"C:\Program Files\Gnu\Sed\sed.exe" -e "s/;/\[\/td\]\[td\]/g" "%infile%" > temp1.txt
"C:\Program Files\Gnu\Sed\sed.exe" -e "s/$/\[\/td\]\[\/tr]/g" temp1.txt > temp2.txt
"C:\Program Files\Gnu\Sed\sed.exe" -e "s/^/\[tr\]\[td\]/g" temp2.txt > temp1.txt
echo [table] > table.txt
type temp1.txt >> table.txt
echo [/table] >>  table.txt
del temp1.txt
del temp2.txt

Hope that helps  smiley

bye bye

Btw: If you drop a file on the bat-file, the path of the dropped file is stored in %1%
Logged
Target
Honorary Member
**
Posts: 1,361



see users location on a map View Profile WWW Give some DonationCredits to this forum member
« Reply #40 on: March 02, 2009, 07:51:51 PM »

you could also do this in Excel using concatenation - this is perhaps not as elegant as some of the other solutions but it's quick and easy and it doesn't have any dependancies...

formula would look something like ="<tr><td>"&A1&"</td><td>"&B1&"</td><td>"&C1&"</td></tr>"

copy and paste the result into your forum (you'll need to add opening and closing table tags) and your done

you could also put your tags into a cell and reference that cell in your formula to save yourself some typing (the cell refs will need to be absolute)
Logged

"Look wise, say nothing, and grunt. Speech was given to conceal thought" - Sir William Osler
tomos
Charter Member
***
Posts: 8,067



see users location on a map View Profile WWW Give some DonationCredits to this forum member
« Reply #41 on: March 03, 2009, 04:23:03 PM »

in which folder have you installed your sed.exe? Lets assume it is in "C:\Program Files\Gnu\Sed\", than you should change the bat-file like this to ensure your sed.exe is found (this is what I meant by "change the path"):
[copy or print]
@echo off
set infile=%1%
"C:\Program Files\Gnu\Sed\sed.exe" -e "s/;/\[\/td\]\[td\]/g" "%infile%" > temp1.txt
"C:\Program Files\Gnu\Sed\sed.exe" -e "s/$/\[\/td\]\[\/tr]/g" temp1.txt > temp2.txt
"C:\Program Files\Gnu\Sed\sed.exe" -e "s/^/\[tr\]\[td\]/g" temp2.txt > temp1.txt
echo [table] > table.txt
type temp1.txt >> table.txt
echo [/table] >>  table.txt
del temp1.txt
del temp2.txt

It finds SED all right now (online armor requested permission to start it) but: a command window opens, closes and nothing else happens ...
the batch file is correct, I've checked it again and again
I copied sed.exe path into file in quotes as you show - it was in C:\Program Files\GnuWin32\bin\sed.exe (just in case)

command window said it couldnt find file path - broke it up in two parts actually, so I moved both files/folders up the tree a bit but now the command window shows completely blank
Is it important where the files are, and where in relation to each other ?
Logged

Tom
crono
Charter Honorary Member
***
Posts: 178


see users location on a map View Profile Give some DonationCredits to this forum member
« Reply #42 on: March 03, 2009, 05:12:21 PM »

Hello again,

[copy or print]
@echo off
REM File which is dropped onto the Batch File
set infile=%1%

REM change the WorkingDirectory to the folder which contains the dropped file
REM The new file table.txt will be created in the same folder as the source file
cd /d %1\..

REM Do the transformation
"C:\Program Files\GnuWin32\bin\sed.exe" -e "s/,/\[\/td\]\[td\]/g" "%infile%" > temp1.txt
"C:\Program Files\GnuWin32\bin\sed.exe" -e "s/$/\[\/td\]\[\/tr]/g" temp1.txt > temp2.txt
"C:\Program Files\GnuWin32\bin\sed.exe" -e "s/^/\[tr\]\[td\]/g" temp2.txt > temp1.txt

REM Build the output
echo [table] > table.txt
type temp1.txt >> table.txt
echo [/table] >>  table.txt

REM Cleanup
del temp1.txt
del temp2.txt

I changed the script to work with comma as separator - the other versions used ";". If it does not work add "PAUSE" (without the quotes) at the end of the batch file (it prevents the command window from being closed) and post the contents and maybe a demo file which should be transformed.

bye smiley
Logged
tomos
Charter Member
***
Posts: 8,067



see users location on a map View Profile WWW Give some DonationCredits to this forum member
« Reply #43 on: March 04, 2009, 04:40:06 AM »

Hello again,
...

I changed the script to work with comma as separator - the other versions used ";". If it does not work add "PAUSE" (without the quotes) at the end of the batch file (it prevents the command window from being closed) and post the contents and maybe a demo file which should be transformed.

bye smiley
hi crono
that's working now Thmbsup
thanks!

the original script didnt work for me with ";" as seperator either (just tried today) so happy to get this one
many thanks again, tom
Logged

Tom
Pages: Prev 1 [2]   Go Up
  Reply  |  New Topic  |  Print  
 
Jump to:  
   Forum Home   Thread Marks Chat! Downloads Search Login Register  

DonationCoder.com | About Us
DonationCoder.com Forum | Powered by SMF
[ Page time: 0.077s | Server load: 0.22 ]