473,394 Members | 1,870 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,394 software developers and data experts.

=?ISO-8859-1?Q?English_=A3_signs_lost_importing_=2Ecsv_file_v ia_ExcelC?==?ISO-8859-1?Q?onnection?=

Hello Group,

I am trying to import data in a .csv file - the data contains English
pound signs (). When importing data via filestreams etc I use the
"Default" code page - which is 1252 (ISO 8859-1). However I can see no
way to make the import of my csv file aware of this in the following
scenario, and the imported data contains character strings instead of
pound signs.

Can anyone help?

sPath = finputFile.DirectoryName

ExcelConnection = New
OleDb.OleDbConnection("Provider=Microsoft.Jet.OLED B.4.0;Data Source= "
+ sPath + ";Extended Properties='text;HDR=Yes;FMT=Delimited;IMEX=1;'")
Try
Using ExcelCommand As New OleDb.OleDbCommand("SELECT *
FROM " + finputFile.Name, ExcelConnection)

Using ExcelAdapter As New
OleDb.OleDbDataAdapter((ExcelCommand)
ExcelConnection.Open()

Using ExcelDataSet As New DataSet()
ExcelAdapter.Fill(ExcelDataSet, "Supplier")
'// Create the XML file
oXMLDoc = New XmlDocument
oXMLDoc.PreserveWhitespace = True
oXMLDoc.LoadXml(ExcelDataSet.GetXml())
oXMLDoc.Save(msInputXMLFile)

End Using

End Using

End Using
Finally
Thanks,
Jim
Aug 20 '08 #1
1 1811
I just wanted to mention that codepage 1252 is _NOT_ the same as ISO
8859-1. Here are the differences (character names are in german):

=/*;PositionDec;PositionHex;CP1CharDec;CP1CharHex; CP1Char;CP2CharDec;CP2CharHex;Cp2Char;CP1CharinCP2 PosDec;CP1CharinCP2PosHex;CP2CharinCP1PosDec;CP2Ch arinCP1PosHex;CP1CharName;CP2CharName
*;128;0x80;8364;€;0x20AC;128;€;0x80;0;0x00;0; 0x00;Euro-Zeichen;<Steuerung>
*;130;0x82;8218;‚;0x201A;130;‚;0x82;0;0x00;0; 0x00;Einfaches
Anführungszeichen unten;Hier ist ein Zeilenumbruch zugelassen
*;131;0x83;402;ƒ;0x192;131;ƒ;0x83;0;0x00;0;0x0 0;Kleiner lateinischer
Buchstabe F mit Häkchen;Hier ist kein Zeilenumbruch zugelassen
*;132;0x84;8222;„;0x201E;132;„;0x84;0;0x00;0; 0x00;Doppeltes
Anführungszeichen unten;<Steuerung>
*;133;0x85;8230;…;0x2026;133;…;0x85;0;0x00;0; 0x00;Horizontale
Ellipse;Nächste Zeile
*;134;0x86;8224;*;0x2020;134;†;0x86;0;0x00;0; 0x00;Kreuz;Anfang des
ausgewählten Bereichs
*;135;0x87;8225;‡;0x2021;135;‡;0x87;0;0x00;0; 0x00;Doppelkreuz;Ende des
ausgewählten Bereichs
*;136;0x88;710;ˆ;0x2C6;136;ˆ;0x88;0;0x00;0;0x0 0;Modifikationszeichen
Zirkumflex-Akzent;Zeichentabellensatz
*;137;0x89;8240;‰;0x2030;137;‰;0x89;0;0x00;0; 0x00;Promillezeichen;Zeichentabellensatz
mit Ausrichtung
*;138;0x8A;352;*;0x160;138;Š;0x8A;0;0x00;0;0x0 0;Großer lateinischer
Buchstabe S mit Caron;Zeilentabellensatz
*;139;0x8B;8249;‹;0x2039;139;‹;0x8B;0;0x00;0; 0x00;Einfaches spitzes
Anführungszeichen nach links;Partielle Zeile nach unten
*;140;0x8C;338;Œ;0x152;140;Œ;0x8C;0;0x00;0;0x0 0;Große lateinische
Ligatur Oe;Partielle Zeile nach oben
*;142;0x8E;381;Ž;0x17D;142;Ž;0x8E;0;0x00;0;0x0 0;Großer lateinischer
Buchstabe Z mit Caron;Einfaches Umschalten zwei
*;145;0x91;8216;‘;0x2018;145;‘;0x91;0;0x00;0; 0x00;Einfaches linkes
Anführungszeichen;Benutzerdefinierte Verwendung eins
*;146;0x92;8217;’;0x2019;146;’;0x92;0;0x00;0; 0x00;Einfaches rechtes
Anführungszeichen;Benutzerdefinierte Verwendung zwei
*;147;0x93;8220;“;0x201C;147;“;0x93;0;0x00;0; 0x00;Doppeltes linkes
Anführungszeichen;Satzübertragungsstatus
*;148;0x94;8221;”;0x201D;148;”;0x94;0;0x00;0; 0x00;Doppeltes rechtes
Anführungszeichen;Abbrechungszeichen
*;149;0x95;8226;•;0x2022;149;•;0x95;0;0x00;0; 0x00;Aufzählungszeichen;Wartende
Meldung
*;150;0x96;8211;–;0x2013;150;–;0x96;0;0x00;0; 0x00;Bindestrich;Anfang des
geschützten Bereichs
*;151;0x97;8212;—;0x2014;151;—;0x97;0;0x00;0; 0x00;Gedankenstrich;Ende
des geschützten Bereichs
*;152;0x98;732;˜;0x2DC;152;˜;0x98;0;0x00;0;0x0 0;Kleine Tilde;Anfang der
Zeichenfolge
*;153;0x99;8482;™;0x2122;153;™;0x99;0;0x00;0; 0x00;Warenzeichen;<Steuerung>
*;154;0x9A;353;š;0x161;154;š;0x9A;0;0x00;0;0x0 0;Kleiner lateinischer
Buchstabe S mit Caron;Einführungszeichen für einzelnes Zeichen
*;155;0x9B;8250;›;0x203A;155;›;0x9B;0;0x00;0; 0x00;Einfaches spitzes
Anführungszeichen nach rechts;Einführungszeichen für Steuerungssequenz
*;156;0x9C;339;œ;0x153;156;œ;0x9C;0;0x00;0;0x0 0;Kleine lateinische
Ligatur Oe;Zeichenfolgen-Abschlusszeichen
*;158;0x9E;382;ž;0x17E;158;ž;0x9E;0;0x00;0;0x0 0;Kleiner lateinischer
Buchstabe Z mit Caron;Datenschutzmeldung
*;159;0x9F;376;Ÿ;0x178;159;Ÿ;0x9F;0;0x00;0;0x0 0;Großer lateinischer
Buchstabe Y mit Diärese;Anwendungsprogrammbefehl
1252~Windows-1252~Westeuropäisch (Windows) »
28591~iso-8859-1~Westeuropäisch (ISO)

But ISO 8859-1 (codepage 28591) has the same characters at different
codepoint positions like the codepages
37,500,1047,20273,20277,20278,20280,20284,20285,20 297,20871

If you plan to work with international textfiles stop using textpad. It
doesn't support working with unicode files that contain multiple scripts.
Regards,
Peter
Aug 21 '08 #2

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

Similar topics

10
by: GrayGeek | last post by:
After cx_Oracle and the related Oracle tools for Python 2.2.3 + Boa-constructor on Win2000, I added "import cx_Oracle" to the top of a test script. It gives me an error about being unable to find...
2
by: Vincent Poinot | last post by:
I'd like to implement some sort of search function on my site, so I took Google sample code and tried it, i.e. basically: <form method="GET" action="http://www.google.com/search"> <input...
2
by: mb12036 | last post by:
All- Having a problem installing a DB2 client on a machine running AIX version 5.0. Client appeared to install one time succesfully, then was uninstalled and a reinstall was attempted. For...
1
by: srihari | last post by:
Hai, I am trying to install IBM DB2 8.1 on Red Hat linux 8.0. My machine is Intel XEON 64bit. The installation went well except for the creation of tools catalog. When I tried to install the tools...
3
by: gelbeiche | last post by:
I have a question regarding the following small C program. #include <locale.h> int main() { char* loc = 0; char before,after; int i;
10
by: | last post by:
In .NetCF, upon trying to access the following URL: http://rss.news.yahoo.com/rss/business via the following code: WebRequest webReq = WebRequest.Create(url); WebResponse webResp =...
1
by: Timiun | last post by:
Hey! I got a rather anoying problem here. I'm making a webmail application, that collects webmail from different POP3 servers. Fine - it works - allmost. The problem is encoding - or should I...
14
by: abhi147 | last post by:
Hi , I want to convert an array of bytes like : {79,104,-37,-66,24,123,30,-26,-99,-8,80,-38,19,14,-127,-3} into Unicode character with ISO-8859-1 standard. Can anyone help me .. how should...
14
by: Ioannis Vranos | last post by:
The following code does not work as expected: #include <wchar.h> #include <locale.h> #include <stdio.h> #include <stddef.h> int main() {
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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...
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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...

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.