473,396 Members | 1,847 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,396 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 6484
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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.