import UNIX to sql

  • Hi guys, I am getting pipe delimeted files from SAP and importing them into SQL using SSIS. I have found that the last row in the files is never imprted even though previewing the file connection in SSIS shows it.

    ANy ideas why?

    also, the last column in a file imports a space. This space is not found in the file.

    I assume these are UNIX formatting issues, but how do I fix it?

    thanks guys

    Ian Cockcroft
    MCITP BI Specialist

  • I would guess that this is a <CR><LF> vs. <LF> end of line delimiter issue. Windows typically uses <CR><LF> (ASCII(10) & ASCII(13)) while Unix typically uses just <LF>.

    In your flat file source, you can change the row delimiter from {CR}{LF} to {LF}.

    HTH,

    Rob

    Edit: Now in rereading your post, I don't think it's an end of line delimiter issue.

  • Hi Rob, yes, I have been using LF and CR to remove the LF from the end of each row but the last row in a file is not imported. I think it has an EOF sequence.

    Maybe there is a SSIS task to convert the file from UNIX to DOS before it gets imported?

    any ides?

    Ian Cockcroft
    MCITP BI Specialist

  • I had a coworker at a previous job who used a command line utility (can't remember which one) and piped (he used Cygwin -- *nix like command line shell for Windows) the data files through it to convert to Windows format.

    Here is an example of one of these utilities: http://www.sg-chem.net/u2win/

    It's not a great solution, but you could run an executable in a SSIS script task to de-unix-ify the incoming data file.

    -- -- -- --

    Another thought is to look at the incoming file in an editor (like Vim) that can show the ASCII values of the individual characters. That might shed some light.

    Rob

  • Thanks Rob, trying VIM to see what the files look like.

    Ian Cockcroft
    MCITP BI Specialist

Viewing 5 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply