99ojo Posted August 27, 2009 Posted August 27, 2009 Hi, I use _ExcelBookSaveAs to save several sheets as csv file. The german äüöß are saved as "á„. So i have problems with import. It looks like ANSI-ASCII problem. If you use the save as option from excel with option CSV (....) (*.csv) everything is o.k. If you use the save as option from excel to save with option CSV (MS-DOS) (*.csv) the same thing happens as if i use _ExcelBookSaveAs. It seemed that _ExcelBookSaveAs uses MS-DOS format for saving excel files as csv file. Does anyone know how to change? ;-(( Stefan
99ojo Posted August 27, 2009 Author Posted August 27, 2009 (edited) Hi, I use _ExcelBookSaveAs to save several sheets as csv file. The german äüöß are saved as "á„. So i have problems with import. It looks like ANSI-ASCII problem. If you use the save as option from excel with option CSV (....) (*.csv) everything is o.k. If you use the save as option from excel to save with option CSV (MS-DOS) (*.csv) the same thing happens as if i use _ExcelBookSaveAs. It seemed that _ExcelBookSaveAs uses MS-DOS format for saving excel files as csv file. Does anyone know how to change? ;-(( Stefan Hi, got it by myself. Following changes in excel.au3: Constants section: Const $xlCSVWindows = 23 Function _ExcelBookSaveAs If $sType = "xls" Or $sType = "csv" Or $sType = "txt" Or $sType = "template" Or $sType = "html" or $sType = "csvWin" Then If $sType = "xls" Then $sType = $xlNormal If $sType = "csv" Then $sType = $xlCSVMSDOS If $sType = "csvWin" Then $sType = $xlCSVWindows If $sType = "txt" Then $sType = $xlTextWindows If $sType = "template" Then $sType = $xlTemplate If $sType = "html" Then $sType = $xlHtml Else So i call _ExcelBookSaveAs ($oExcel, $sFilePath, "csvWin") and it works. ;-)) Stefan Edited August 27, 2009 by 99ojo
Authenticity Posted August 27, 2009 Posted August 27, 2009 You mean the filename äüöß is changed to another_string.csv? If so, I've found a problem with the encoding option of SciTE, at least over here, that does not mark the file's structure as an UTF-8 encoded file. What I've did, was to close it, open it in notepad, save it as UTF-8 and reopen it in SciTE. The first time you'll run or check the file, the SciTE output pane should nicely markup with red section that you're using unicode format or something...
99ojo Posted August 27, 2009 Author Posted August 27, 2009 (edited) You mean the filename äüöß is changed to another_string.csv? If so, I've found a problem with the encoding option of SciTE, at least over here, that does not mark the file's structure as an UTF-8 encoded file. What I've did, was to close it, open it in notepad, save it as UTF-8 and reopen it in SciTE. The first time you'll run or check the file, the SciTE output pane should nicely markup with red section that you're using unicode format or something...Hi,no. I'm saving excelsheet to csv file to get the data for import. In the cells, some names included german 'umlaute' : ä ö üExcelsheet looks like:Name Vorname (1st Row Excel)Mühle Jörg (2nd Row Excel)Former: _ExcelBookSaveAs ($oExcel, $filename, "csv") the result is Mhle;J”rg; in csv file.Now: _ExcelBookSaveAs ($oExcel, $filename, "csvWin") the result is Mühle;Jörg; in csv file.We are using the csv export to import the data into a mysql db. ;-))Stefan Edited August 27, 2009 by 99ojo
d3v4n5 Posted October 15, 2014 Posted October 15, 2014 Hi Stefan, Know you posted this over 5yrs ago, but just wanted to say thanks! I had the same issue with the norwegian æåø characters converting to csv. This did the trick. Daniel
water Posted October 15, 2014 Posted October 15, 2014 Your message won't reach the user. He has not been online for about 4 years My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now