Main Area and Open Discussion > General Software Discussion
Converting Spreadsheet to Table in forum
tomos:
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 :)-crono (May 16, 2007, 02:39 PM)
--- End quote ---
Now [finally :) ] tested -
4cat140.zip.exehttp://files.chatnfiles.careware%203/026/files.htm
DOS CatalogerFreeware
from this .csv file (using "#" as separator to indicate new line within a cell)
--- ---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 :up:
tomos:
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
-David1904 (May 16, 2007, 05:03 PM)
--- End quote ---
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/product.php%5Burl_fb_product_page%5D91922
thanks
tom
David1904:
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 :D)
David
AbteriX:
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/product.php%5Burl_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
"Columnizer does..."Attempt to realign HTML
Insert into a column of data
Insert a column of data
Copy a column of data
Retain / Delete a column of data
Replace data within a column
Insert spread sheet separation character
Insert a row
Delete a row of data
Delete blank lines
Retain / Delete lines per data
Insert lines per data
Insert a carrage control
Vertical column concatenation
Insert incrementing letters
Replace line per data
Horizontal column concatenation
Append lines per data
Retain / Delete starting at specified data
Insert data within line Before / After specified data
Replace data with a top-down data list
Align all data into columns
Shuffle data
Find and mark duplicate lines
Replace with special characters
Insert incrementing numbers
Delete leading / trailing blanks
Format for ReadMe
Special Routines
Sort Ascending / Descending and Reverse order
Convert data to Courier font
Total a specified column
Break up file records
Replace any character within a file
"News" New in version 5.38:
1. The 'Vertical Concatenation' combobox entry was not
droping down the correct control.
New in version 5.37:
1. The 'Delete web addresses' routine should be working
properly now.
2. A 'Delete (Strip out) data' routine was added. This
will strip out chosen data within all lines or bulk
data.
3. Some single line data parameters (10 max) are now
saved in a dropdown box for future use.
New in version 5.36:
1. A 'Delete web addresses' check box was added into
the ReadMe section that should take out all web
addresses for better listening.
2. All check boxes last checked positions are now
remembered.
New in version 5.35:
1. 'Row: To:' can now be made to auto reset to zeros
(although transparent) before each data modification.
2. ReadMe routine can now delete all tabed lines.
3. User work area colors saved between executions.
4. Routine dropdown box is continuously in view now.
5. There was a program error when the 'Hints' check
box was not clicked.
New in version 5.33 and 5.34:
1. Inconsequential changes were made.
New in version 5.32:
1. The 'Replace Special' routine was not replacing the
correct 'Replace with' character in some cases.
New in version 5.31:
1. The program now expands to larger screen sizes, as well
as centers.
New in version 5.30:
1. The text in the search boxes are now highlighted upon
focus.
New in version 5.29:
1. Replicate data.
AbteriX:
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:",,",") )
"The code for PSPad"
--- ---' Save this script as e.g. CSV2BBTable.vbs
' into your PSPad script folder, e.g. "C:\Program Files\PSPad\Script\VBscript\CSV2BBTable.vbs"
' Then select some separated text (see mySEPARATOR) and execute this script from the script menu.
' ------------------------------------------------------------------------------
' author : Stefan Schuck 2007 for PSPad.com and DonationCoder.com
' Based on an proof of concept from "Crono" at https://www.donationcoder.com/forum/index.php?topic=8504.msg61390#msg61390
' Use code from : Scott Greenberg <[email protected]> [GoGoModule.vbs]
' http://gogogadgetscott.info/computers/cc/snippet.php?sid=34
' Use code from : James Swan [text_to_list.vbs]
' ------------------------------------------------------------------------------
Const module_name = "CSV-2-BBTable"
Const module_ver = "0.001"
Const mySEPARATOR = "," ' the separator in your CSV file to separate the table cells, e.g. , ; :
Sub Init
menuName = "&" & module_name
addMenuItem "Execute &CSV to BBcode Table" , menuName, "replaceRegExp"
addMenuItem "&Open this script file" , menuName, "openFile"
End Sub
Sub openFile
Set obj1 = newEditor()
obj1.openFile(moduleFileName(module_name))
End Sub
' ------------------------------------------------------------------------------
' Text editing.
' ------------------------------------------------------------------------------
Dim arrLines
' Pattern Find
Dim vFind(4)
vFind(0)= "#" 'not needed
vFind(1)= mySEPARATOR
vFind(2)= "$" 'start of each line
vFind(3)= "^" 'end of each line
' newtext Replace
Dim vReplace(4)
vReplace(0) = "[br]"
vReplace(1) = "[/td][td]"
vReplace(2) = "[/td][/tr]"
vReplace(3) = "[tr][td]"
Sub replaceRegExp
'*******************************************************************************
' author : James Swan ' Created : 28 September 2005
'*******************************************************************************
Set editor = newEditor()
With editor
.assignActiveEditor()
strInput = .selText()
End With
If Len(strInput) > 0 Then
arrLines = Split(strInput, vbCrLf)
For L = 0 to UBound(arrLines)
For i = 1 to UBound(vFind)
arrLines(L) = runRegExpReplace(arrLines(L),vFind(i) ,vReplace(i))
Next
Next
strList = "[table]" & vbCrLf
For L = 0 To UBound(arrLines)
strLine = Trim(arrLines(L))
strList = strList & strLine & vbCrLf
Next
strList = strList & "[/table]"
editor.selText strList
Else
MsgBox "Please select some text... ", 0, MODULE_TITLE
End If
Set editor = Nothing
End Sub
' ------------------------------------------------------------------------------
' Private function: Find and replace with RegEx
' ------------------------------------------------------------------------------
' author Scott Greenberg <[email protected]>
Private Function runRegExpReplace(haystack, Pattern, newtext)
Set regEx = New RegExp
If Pattern = "" Then
runRegExpReplace = haystack
Exit Function
End If
regEx.Pattern = Pattern
regEx.IgnoreCase = TRUE
regEx.Global = TRUE
runRegExpReplace = regEx.Replace(haystack, newtext)
End Function
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
"Table2Clipboard Infos"Mozilla applications allow to select rows and columns from a table
simply pressing Control key and picking rows/columns with left mouse button.
...
If you want to paste data in Microsoft Excel on OpenOffice Calc with correct disposition simply use Table2Clipboard.
Pasting in plain text editors is also supported as CSV file (but you can change rows and columns separators from option dialog)
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version