473,321 Members | 1,916 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,321 software developers and data experts.

convert XLS to CSV with charset convertion

Hi,

I have an excel file with charset "windows-1250" and i would like to
convert it to CSV file with charset "UTF-8"

how can i do that ?

thanks a lot,

Al.
Aug 15 '07 #1
3 6477
Alain,

Do you have Excel installed on the machine and are you running this in a
non-ASP.NET application? If so, then I would automate Excel to open up the
file, and then just call the SaveAs method on the workbook, specifying the
CSV file format.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Alain R." <no*****@nospam.comwrote in message
news:e0**************@TK2MSFTNGP06.phx.gbl...
Hi,

I have an excel file with charset "windows-1250" and i would like to
convert it to CSV file with charset "UTF-8"

how can i do that ?

thanks a lot,

Al.

Aug 15 '07 #2
Hi,

so yes, excel is installed on the computer and it should run under
C#.net program only.

for now, i did the following thing :
open an OLEDB connection to excel file and line by line save it to
another file format CSV.

and i would like to convert string (line) to UTF-8 before saving it to CSV.

Al.

Nicholas Paldino [.NET/C# MVP] wrote:
Alain,

Do you have Excel installed on the machine and are you running this in a
non-ASP.NET application? If so, then I would automate Excel to open up the
file, and then just call the SaveAs method on the workbook, specifying the
CSV file format.

Aug 15 '07 #3
Alain,

That seems pretty roundabout, and too much code that you have to put
together.

Why not just call this?

http://msdn2.microsoft.com/en-us/lib...as(VS.80).aspx

Here is some more information on saving workbooks in Excel:

http://msdn2.microsoft.com/en-us/lib...36(VS.80).aspx

Note that you will want to set the FileFormat parameter to xlCSV. For
more information on file formats, check here:

http://msdn2.microsoft.com/en-us/lib...at(VS.80).aspx
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com
"Alain R." <no*****@nospam.comwrote in message
news:Of****************@TK2MSFTNGP06.phx.gbl...
Hi,

so yes, excel is installed on the computer and it should run under C#.net
program only.

for now, i did the following thing :
open an OLEDB connection to excel file and line by line save it to another
file format CSV.

and i would like to convert string (line) to UTF-8 before saving it to
CSV.

Al.

Nicholas Paldino [.NET/C# MVP] wrote:
>Alain,

Do you have Excel installed on the machine and are you running this
in a non-ASP.NET application? If so, then I would automate Excel to open
up the file, and then just call the SaveAs method on the workbook,
specifying the CSV file format.
Aug 15 '07 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Swarup | last post by:
I am reading a file (txt, xml, gif, ico, bmp etc) byte by byte and filling it into a byte arry. Now i have to convert it into a string to store it in the database. I use...
2
by: Du Dang | last post by:
I tried to convert a block of text from iso-8859-1 to utf-8 but all I got after the convertion is gibberish. =============================== FileStream fs = File.Open("text.txt",...
4
by: Albert Jan | last post by:
Hi, I have text from mime email messages with different encoding that I want to convert to utf-8, but I'm relatively new on encoding problems. I use the following code, but this doesn't seem...
7
by: EOS | last post by:
Hi, I would like to ask on how to convert array of bytes, Byte into String? I tried StringIwant = System.Convert.ToString(byteData); but it actually return "System.Byte" rather than convert...
6
by: PenguinPig | last post by:
Dear All Experts I would like to know how to convert a HTML into Image using C#. Or allow me contains HTML code (parsed) in Image? I also tried this way but it just display the character "<" &...
2
by: ElizaInternet | last post by:
I need convert NITF Xmls for insert into BD SQL. I try convert to file text and then insert into BD I used the Syndication:NITF of perl for this convertion. Any have information about this??, I...
1
by: johnlim20088 | last post by:
Hi, Currently I have 6 web projects located in Visual Source Safe 6.0, as usual, everytime I will open solution file located in my local computer, connected to source safe, then check out/check in...
0
by: Zmische | last post by:
Platform: IIS6, windows 2000 Server, ASP + VBSCRIPT I have an ASP application that posts FORM via XMLHttprequest (javascript) so that all data is posted in UTF-8. So I have an ASP that get data in...
0
by: Michael Postmann | last post by:
Hello! I have Oracle 10g using AL32UTF8 as internal charset. I have a documents table where uploaded files (I'm using modplsql web-gateway (release 8i)) are stored in a blob-column. I upload a...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.