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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

COPY FROM erroring on \r \n

Status
Not open for further replies.

vbMonk

MIS
Jun 20, 2003
19
US
I'm trying to copy a text file into a table. The copy command fails on the first record and I believe it's because it's trying to copy the \r\n characters at the end of each line. Is there a way to copy the file and exclude these special characters? To strip them out of the file itself?
 
Hi

I think the record separator is the given operating system's end-of-line mark. No idea if can be modified.

I would simply remove the [tt]\r[/tt] characters from the line end. For example on Linux using GNU [tt]sed[/tt] :
Code:
sed -i 's/\r$//' thefile.sql
But there are special little tools for end-of-line mark conversion on each operating system.

Feherke.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top