How can I save an Excel spreadsheet as .csv with a semicolon, instead of
comma, delimiter?
When I save the spreadsheet in Excel as CSV the file is saved with
semicolon delimiter and text in double quotes. This allows for
end-of-line characters to be properly imported. The latter in the
destination iPhone app: CSV Touch.
Tab or comma separated doesn't preserve the end-of-line chars en so a
field with EOL gets spread over multiple lines instead of one field.
Maybe it's off-topic but the microsoft AS doc didn't help much either.
(
http://download.microsoft.com/download/3/A/7/3A70FB4B-0C6A-43E3-AAB7-AC9
166B25632/Excel2004AppleScriptRef.pdf )
I hope someone in this AS group can help me out.
The following script saves a comma-separated CSV file:
<appleScript>
-- select the spreadsheet (only Excel 2008 filetype, XLS8)
set theSpreadsheet to (choose file with prompt "Choose the spreadsheet
to be published..." of type "XLS8")
set theInfo to the info for theSpreadsheet
set theFilename to name of theInfo
-- open the spreadsheet and save as CSV file
tell application "Microsoft Excel"
open workbook workbook file name theFilename
--save active workbook in "gelezen.csv" as CSV
save as active sheet filename "gelezen.csv" file format CSV
--tried to set delimiter and text file delimiter semicolon
--but these seem to only pertain to imported files
--none of these file fomats do the trick:
--file format CSV Mac
--file format CSV MSDos
--file format CSV Windows
--file format XML spreadsheet
--file format DBF2
--format DBF3
--format DBF4
--workbook
--"international add in" -- doesn't work
--text windows
--SYLK
--text Mac -- tab delimited
--text MSDos
--works
close active workbook saving no
end tell
</appleScript>
--
_____________________________________
Ing. Johan van Oostrum
chaos geordend -
www.chaosgeordend.nl
_____________________________________