Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Carriage Return

Status
Not open for further replies.

Bertramp

Technical User
Dec 12, 2006
11
GB
HI,

I am runnin a utility to parse and import XLM files into a Mysql database on Windows however, the problem i am facing is that in some of the tables i have notice that on certain fields there is a training carriage return character. The same utility run on Linux + Mysql doesn't have that problem - running the same utility using MS Sql Server also doesn't have that problem.

I am using windows 2000 professional and Mysql version 5.0.27

Anyone face this problem before??

Bert
 
No but it sounds like you're utility might not play nice with MySQL. What program is it?
 
it's an import utility built in-house - it's a java based application and works just fine on Linux - It works just fine with Sql Server and mysql on Linux - Seems like something with the Windows / Mysql combination

Bert
 
Yeah. It's kind of hard to troubleshoot proprietary tools in the forums so not sure if anyone will be able to help out.

Good luck!
 
Are there any known issues with Mysql on windows??

Bert
 
If you create a table on a windows box it will by default create a table with rows that end crlf or \r\n or 0D0A.

If you create a table on a nix box or almost any other operating system it terminates rows with lf or \n of 0A character.

You have to handle this in your script/program making sure you stip off the spurios \r that windows uses. In mysql

load data infile 'myfile'
into mytable
fields terminated by '\t'
lines terminated by '\r\n' #for windows
lines terminated by '\n' #for the rest of the world

In perl things are a lot easier as perl seems to sense what the record terminator on the file is and you just need to chomp(<INPUT>)

Java - dont know
 
thanks for the response hvass - I understand what you're saying but this is only happening on 4 tables on sepecific columns out of 27 tables

Bert
 
Thanks Hvass - that indeed was the problem - It has been resolved

Regards
Bert
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top