Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Importing excel having merged cell in SSIS

My problem is while reading excel file having column cells merged/combined. For example, read below excel data to database.

Excel Input:

+----+-------+---------+-------+
| ID |      NAME       | DEPT  |
+----+-------+---------+-------+
|    | FNAME | LNAME   |       |
+----+-------+---------+-------+
|  1 | Akil  | Tiwari  | IT    |
|  2 | Vinod | Rathore | IT    |
|  3 | Jatin | Khanna  | HR    |
|  4 | Divya | Kherde  | AD    |
|  5 | Amey  | Gauda   | FI    |
+----+-------+---------+-------+

Expected Database Output:

+----+-------+---------+------+
| ID | FNAME |  LNAME  | DEPT |
+----+-------+---------+------+
|  1 | Akil  | Tiwari  | IT   |
|  2 | Vinod | Rathore | IT   |
|  3 | Jatin | Khanna  | HR   |
|  4 | Divya | Kherde  | AD   |
|  5 | Amey  | Gauda   | FI   |
+----+-------+---------+------+
like image 856
Avineshkumar Tiwari Avatar asked Jan 18 '26 09:01

Avineshkumar Tiwari


1 Answers

Just connect your excel normally the Excel Connection manager will read it like the following:

+----+-------+---------+-------+
| ID | NAME  | F3      | DEPT  |  <-- Header
+----+-------+---------+-------+
|    | FNAME | LNAME   |       |  <--First Row
+----+-------+---------+-------+
|  1 | Akil  | Tiwari  | IT    |  <-- Second Row
|  2 | Vinod | Rathore | IT    |   .
|  3 | Jatin | Khanna  | HR    |   .
|  4 | Divya | Kherde  | AD    |   .
|  5 | Amey  | Gauda   | FI    |   .
+----+-------+---------+-------+

In the Excel Source Just rename columns like below"

NAME --> FNAME
F3   --> LNAME

enter image description here

Then Just add a Conditional Split that filter rows that have ID = NULL using the following expression

ISNULL([ID]) == false

enter image description here

Then the First row will be ignored

like image 138
Hadi Avatar answered Jan 21 '26 02:01

Hadi



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!