Solved

Importing ASCII data into SQL database

Posted on 2014-01-08
5
867 Views
Last Modified: 2014-01-28
Hi Guys,

I am importing an ASCII text file into a SQL database.
I have a problem with text-lines in the ASCII file containing special characters.

If a line of text contains a special character (for example in the name / surname) it effects the formatting of that line, and imports incorrectly into the SQL database.

I believe the problem is with the reading of the actual ASCII text file, and the column count.  The special characters seem to move the columns for that line, one or two characters forward.

Is there way of resolving this particular problem?
0
Comment
Question by:Rupert Eghardt
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
5 Comments
 
LVL 52

Accepted Solution

by:
Carl Tawn earned 500 total points
ID: 39764973
How are you importing the data? It sounds like you are dealing with Unicode data rather than pure ASCII - so it is more likely an issue with the import mechanism.
0
 

Author Comment

by:Rupert Eghardt
ID: 39765070
I developed a small import application in Clarion, which reads the ASCII file and writes the records into SQL.

Is there a way perhaps to re-save the ASCII file, to get rid of all the special characters?
0
 
LVL 52

Expert Comment

by:Carl Tawn
ID: 39765081
Do you not need to preserve the input data as it is? Can you modify your import routine to accept unicode instead? Unicode won't be a problem for SQL Server as long as you are storing it in a NCHAR or NVARCHAR.
0
 
LVL 28

Expert Comment

by:Ark
ID: 39781442
Are you speaking specially about single quotes? Just duplicate them. VB code:
correctString=ASCIIString.Replace("'","''")
0
 

Author Comment

by:Rupert Eghardt
ID: 39783511
I am referring to all sorts of special characters, such as in Spanish, Italian, Russian, etc. surnames.

I think Carl is correct, I should change the import routing, but I don't think Clarion can read Unicode from ASCII, not sure though.

Thanks for the help, I will try to find a way in Clarion to read Unicode.
0

Featured Post

[Webinar] Code, Load, and Grow

Managing multiple websites, servers, applications, and security on a daily basis? Join us for a webinar on May 25th to learn how to simplify administration and management of virtual hosts for IT admins, create a secure environment, and deploy code more effectively and frequently.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Load balancing is the method of dividing the total amount of work performed by one computer between two or more computers. Its aim is to get more work done in the same amount of time, ensuring that all the users get served faster.
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
Using examples as well as descriptions, and references to Books Online, show the documentation available for date manipulation functions and by using a select few of these functions, show how date based data can be manipulated with these functions.

738 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question