locked
Creating Flat File Destination(.txt) having fixed width column RRS feed

  • Question

  • I need to create a (.txt) file without column headers, no comma separated values but each column will have a fixed starting position and a fixed length in the text file. For example, below is the text file to be created with three column

    Column1  Column2  Column1

    abc          1             New employee

    xyz          2             Existing

    Fixed starting position and a fixed lenth values for these columns as are below;

    Column1 : Starting Position -1, Fixed Length -4

    Column2 : Starting Position - 8, Fixed Length - 2

    Column3 : Starting Postion - 11, Fixed Length - 30

    Can this be done using FLAT FILE DESTINATION or do i need to write custom logic in the SCRIPT COMPOENENT to generate this format.



    Thursday, August 4, 2011 9:08 AM

Answers

  • Use Flat File connection manager with Ragged Right type  and include column name  by checking check box in connection manager Column names in the first data row.

    and column name position will be same as column data position.

    HTH


    Shailesh , Please mark the post as answered if it answers your question.
    • Marked as answer by Eileen Zhao Friday, August 12, 2011 5:54 AM
    Thursday, August 4, 2011 9:54 AM

All replies

  • Using Flat file destination you can generate Fixed Width File

    see this blog


    Shailesh , Please mark the post as answered if it answers your question.
    Thursday, August 4, 2011 9:14 AM
  • yes, fixed width file can be created using flat file destination but can we generate flat text file having columns at fixed position and width.
    Thursday, August 4, 2011 9:26 AM
  • Use Flat File connection manager with Ragged Right type  and include column name  by checking check box in connection manager Column names in the first data row.

    and column name position will be same as column data position.

    HTH


    Shailesh , Please mark the post as answered if it answers your question.
    • Marked as answer by Eileen Zhao Friday, August 12, 2011 5:54 AM
    Thursday, August 4, 2011 9:54 AM