How to load data from multiple txt files after removing first row into tables?

Ramana Kopparapu 306 Reputation points
2024-11-23T07:58:05.68+00:00

Hi All,

I faced one scenario where i have 6 txt files of different regions. In every text document First Line is not required. How can I remove First line alone and load the data from all six source docs into SQL tables?

Data From North Region

id|name|age|sal

101|ABC|36|2000

102|DEF|38|2500

103|GHI|32|2500

Data From North Region is the first line in this document. Like that I have 6 docs.

SQL Server Integration Services
SQL Server Integration Services
A Microsoft platform for building enterprise-level data integration and data transformations solutions.
2,644 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Yitzhak Khabinsky 26,376 Reputation points
    2024-11-24T00:45:46.2466667+00:00

    Hi @Ramana Kopparapu,

    You can use SSIS Flat File source Adapter in your Data Flow Task (DFT).

    You would need to create a Flat File Connection in its Flat File Connection Manager Editor.

    It has a check box option called "Column names in the first data row".

    There is an additional setting "Header rows to skip" if you need to skip 2 or more rows in the file.

    Please see below.

    Here is a good video tutorial on the subject of loading multiple files.

    SSIS Tutorials - 1.Load multiple Flat Files in SSIS

    https://www.youtube.com/watch?v=9BVTFSJ29-s

    SSIS - Flat File Connection Manager -23-2024_01


  2. ZoeHui-MSFT 40,586 Reputation points
    2024-11-25T02:39:46.6133333+00:00

    Hi @Ramana Kopparapu,

    You may also check this blog step by step.

    SSIS - How To Load Multiple Files ( .txt or .csv ) To a Table With File Names

    Regards,

    Zoe Hui


    If the answer is helpful, please click "Accept Answer" and upvote it.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.