ConvertTABLE-Talk
This space is for User-contributed commentary and notes. Please include your name and a date along with your comment.
Comments
I had this same issue, but was using WinXP and SED for Windows. What's worse is, I'd only used SED once before and that was a few years ago, so forgive me if this isn't very elegant. Below is a .BAT file (you can also use .CMD as the extension). It expects a single parameter, a filename to process. The commands are a combination of SED and some DOS batch commands, so you must have SED loaded and running on the Windows path before this .BAT file will work.
The other caveat is that this process expects a "DOS CSV file" as saved by Excel. After a bit of flogging, I figured out that it was much simpler to start with a very simple format and then use some fairly simple SED commands to format. So, you can use Excel to open an HTML file, then isolate the data you want, and make sure you delete everything else on the spreadsheet you don't want, then do the "Save As..." and save the data as a DOS CSV file. This creates a very simple comma-delimited file.
At that point, just run the ConvertCSVtoPMWikiTABLE.bat program with the file name as the sole parameter. When it finishes, Notepad will open with the converted results, ready to be cut-n-pasted into PmWiki.
if %1'==' goto err1
goto start
:err1
echo off
cls
echo ---------------------------
echo ConvertCSVtoPMWikiTABLE.BAT
echo ---------------------------
echo '
echo You must input the name of the CSV file as the one and only parameter, e.g.
echo '
echo ' ConvertCSVtoPMWikiTABLE ips.csv
echo '
echo This process assumes you have imported a table into Excel, then exported
echo the rows/columns that you want as a MS-DOS CSV file.
echo '
echo '
echo ' written by Robert Laird, 12/20/2005
pause
goto end
:start
rem -----3 steps to this SED pipe...
rem ----- Step 1: replace all comma's with a comma plus a HTML hard space
rem ----- Step 2: append (:cellnr:) to the beginning of each line
rem ----- Step 3: replace all comma's with (:cell:)
rem -----
|
Talk page for the ConvertTABLE recipe (users?).