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

<< < (8/9) > >>

brett:
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),  :)

HTML of 'Demo Input' from previous post (export fast)
Spoiler<!-- THIS FILE WAS CREATED BY MAX'S EXPORT COMPONENTS FOR BORLAND DELPHI -->
<!-- DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN" -->
<HTML>
 <HEAD>
  <META HTTP - EQUIV = "Content - Type" CONTENT = "TEXT/HTML">
  <META NAME = "GENERATOR" CONTENT = "Max's Export Components for Delphi" >
  <TITLE></TITLE>
 </HEAD>
 <BODY BGCOLOR="#FFFFFF" LINK="#0000FF" ALINK="#FF0000" VLINK="#FFFF00" TEXT="#000000">
 <FONT COLOR="#000000" FACE="Arial,Helvetica">
  <HR>
  <TABLE WIDTH="100%" CELLPADDING="4" CELLSPACING="0" BORDER="1" BGCOLOR="#FFFFCF">
  <FONT COLOR="#000000" FACE="Arial,Helvetica">
   <TR BGCOLOR="#336699">
    <TD><B><FONT COLOR="#FFFFFF"><small>Column 1</small></FONT></B></TD>
    <TD><B><FONT COLOR="#FFFFFF"><small>Column 2</small></FONT></B></TD>
    <TD><B><FONT COLOR="#FFFFFF"><small>Column 3</small></FONT></B></TD>
    <TD><B><FONT COLOR="#FFFFFF"><small>Column 4</small></FONT></B></TD>
   </TR>
   <TR>
    <TD><small>13</small></TD>
    <TD><small>»</small></TD>
    <TD><small>Alien Quadrilogy</small></TD>
    <TD><small>0</small></TD>
   </TR>
   <TR BGCOLOR="#FFFFFF">
    <TD><small>16</small></TD>
    <TD><small>?</small></TD>
    <TD><small>Alien: Director's Cut: Special Edition</small></TD>
    <TD><small>2</small></TD>
   </TR>
   <TR>
    <TD><small>17</small></TD>
    <TD><small>?</small></TD>
    <TD><small>Alien Quadrilogy Bonus-Disc</small></TD>
    <TD><small>1</small></TD>
   </TR>
   <TR BGCOLOR="#FFFFFF">
    <TD><small>18</small></TD>
    <TD><small>?</small></TD>
    <TD><small>Alien - Die Wiedergeburt: Special Edition</small></TD>
    <TD><small>2</small></TD>
   </TR>
   <TR>
    <TD><small>19</small></TD>
    <TD><small>?</small></TD>
    <TD><small>Aliens - Die Rückkehr: Special Edition</small></TD>
    <TD><small>2</small></TD>
   </TR>
   <TR BGCOLOR="#FFFFFF">
    <TD><small>20</small></TD>
    <TD><small>?</small></TD>
    <TD><small>Alien³: Special Edition</small></TD>
    <TD><small>2</small></TD>
   </TR>
   <TR>
    <TD><small>21</small></TD>
    <TD><small>21</small></TD>
    <TD><small>American Beauty</small></TD>
    <TD><small>1</small></TD>
   </TR>
   <TR BGCOLOR="#FFFFFF">
    <TD><small>23</small></TD>
    <TD><small>23</small></TD>
    <TD><small>American Psycho: Special Edition</small></TD>
    <TD><small>1</small></TD>
   </TR>
   <TR>
    <TD><small>24</small></TD>
    <TD><small>»</small></TD>
    <TD><small>Ang Lee Limited Edition</small></TD>
    <TD><small>0</small></TD>
   </TR>
  </FONT>
  </TABLE>
  <HR>
Created: 23/05/2007 12:00:54 AM
 </FONT>
 </BODY>
</HTML>

Brett

AbteriX:
Thank you brett for reminding me to CSVed.

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


Can CSVed this too ?

---
Edit:
upps, i had used no separator in my example ... nice too ;-)

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

Please post any opinions !!
-tomos (May 25, 2007, 07:21 AM)
--- End quote ---

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 :P )
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  :up:  :)
tom

tomos:
hi Crono :)

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.
-crono (May 14, 2007, 06:08 AM)
--- End quote ---

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 ;) )

--- ---@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

crono:
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"):

--- ---@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  :)

bye bye

Btw: If you drop a file on the bat-file, the path of the dropped file is stored in %1%

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version