Flat File connection not fixed width but the row length is !!

  • Bit of a bonkers file, but has a fixed number of columns in the file. All columns are ok and are delimited with commas, apart from the last column. The last column should be an integer but is padded to the right with spaces to ensure each row in the file contains a fixed number of characters. For most of this we seem to be ok till the field does not contain an integer, so its just spaces then it fails.

    Any suggestions for resolving this?

    Cheers

    E

  • What about importing last column as a string and using a derived column to validate and convert value into int?

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • Luis Cazares (1/8/2014)


    What about importing last column as a string and using a derived column to validate and convert value into int?

    +1 that's what I'd do too.

    The absence of evidence is not evidence of absence
    - Martin Rees
    The absence of consumable DDL, sample data and desired results is, however, evidence of the absence of my response
    - Phil Parkin

  • I had considered that as an option but was wondering if there is a nice smart trick as I wanted to capture any issues with non conformity of data at the flat file source task rather than derived column.

    Have considered running through the file with script task to remove the spaces at the end but that can be time consuming as you dont have a consistent number of spaces at the end.

    Have considered using the space as the row delimiter but that does not seem to work either.

    Thanks

    E

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

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