Results 1 to 5 of 5
  1. #1
    Join Date
    Sep 2010
    Posts
    3

    Unanswered: Loading windows CSV file on Linux without dos2unix

    I have some very large data files (several 100 GB) that I want to load into a Linux version of Oracle via sqlldr. Unfortunately the files were created on a windows machine and contain the extra windows ^M linefeed. When I try to load the files with the extra newline, sqlldr has an error.

    Is there any way for me to use sqlldr without having to run dos2unix on the data files first? The files are large enough that this takes several hours to complete, and I have to do this frequently enough for it to be very annoying. I unfortunately do not have control over the source data, so cannot change it to come with unix newlines.

  2. #2
    Join Date
    Aug 2003
    Location
    Where the Surf Meets the Turf @Del Mar, CA
    Posts
    7,776
    Provided Answers: 1
    >I unfortunately do not have control over the source data, so cannot change it to come with unix newlines.
    Not necessarily.

    If the files are transfered from Windows to *nix using "ftp" in ASCII mode;
    then the extra character will be eliminated as part of the transfer process.

    Try it; you'll like it!
    You can lead some folks to knowledge, but you can not make them think.
    The average person thinks he's above average!
    For most folks, they don't know, what they don't know.
    Good judgement comes from experience. Experience comes from bad judgement.

  3. #3
    Join Date
    Sep 2010
    Posts
    3
    Thanks for the tip. Unfortunately my data source is coming on a external hard drive, so there's no FTP or network transfer involved at this point. The FTP overhead would actually be more than dos2unix .

    Any other suggestions?

  4. #4
    Join Date
    Jun 2003
    Location
    Toronto, Canada
    Posts
    5,516
    Provided Answers: 1
    I think you can specify multibyte record delimiters in the control file:

    Code:
     ... INFILE file.txt "STR X'0d0a'" ...

  5. #5
    Join Date
    Sep 2010
    Posts
    3
    Quote Originally Posted by n_i View Post
    I think you can specify multibyte record delimiters in the control file:

    Code:
     ... INFILE file.txt "STR X'0d0a'" ...
    Excellent, that works wonderfully - thanks!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •