Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Microsoft is giving away 50,000 FREE Microsoft Certification exam vouchers. Get Fabric certified for FREE! Learn more

suparnababu8

Optimizing CSV Ingestion: Transforming Space-Delimited Headers into Delta Tables within Lakehouse

Hello Fabric Users!!!

In this article, I will demonstrate how to dynamically load a CSV file with space-delimited headers into a Lakehouse as Delta tables by using Dataflow Gen-2


This is my Fabric workspace in the csvload_LH ,I  have Sales Order.csv file (1) and am using Load to Tables (2) and creating New table(3) 

 

suparnababu8_0-1741164201512.png

 

 

Now I will click on Load (4) 

 

suparnababu8_0-1741160641001.png

 

It throws an error (5) and clearly telling that, column headers having spaces not allowed. We have to use (6) underscore(_)

 

suparnababu8_0-1741160739949.png

 

This is the dataset I'm trying to load. Here column headers(7) having the spaces. Now here we have only few columns may be we will add underscore manually but what if we have 200+ coulmns in real time. 

 

suparnababu8_1-1741160862666.png

 

 

Now I will create a Dataflow Gen2 called Dataingestion_DF(8) and click on Get data from another source(9)

 

suparnababu8_0-1741161110341.png

 

Now click on OneLake (10) and click on csvload_LH (11)

 

suparnababu8_1-1741161288386.png

 

Now under Files dropdown select Sales Orders.csv (12) and clcik on Create (13)

 

suparnababu8_2-1741161431612.png

 

Now Column headers as showing as rows (14) click on Use first row as headers (15) and renamed as Sales_Orders_TB (16)

 

suparnababu8_1-1741162390096.png

 

Now we have column headers (17) and click on + symbole to add destination (18)

 

suparnababu8_0-1741170051549.png

 

 

Select Lakehouse (19)

 

suparnababu8_1-1741170099609.png

 

 

Click on Create (20)

 

suparnababu8_2-1741170149699.png

 

 

Now choose New table(21) select csvload_LH (22), check the tbale name(23) and click on Next (24)

 

suparnababu8_3-1741170201750.png

 

 

 

Now all the column headers having space(25) automaically converted to underscore(_) (26) and click on Save settings (27)

 

suparnababu8_4-1741170266920.png

 

 

Now destination added (28) and click on Publish (29)

 

suparnababu8_5-1741170312356.png

 

 

Dataflow published successfully (30) and click on Lakehosue (31)

 

suparnababu8_6-1741170367974.png

 

 

Now Sales_Orders_TB (32) populated in Tables Section as Delta table. If you see all columns (33) properly aligned with underscore (_)

 

suparnababu8_7-1741170416219.png

 

 

 

This is one of way to load the csv files that having column headers with spaces by using dataflows in Fabric. 

I hope it will be clear for all.

 

Thank you for reading this blog.

 

Regards

Inturi Suparna Babu

Comments

It's a wonderful article, it helps alot.

Thanks for sharing how to solve the column header issue in Fabric. Nicely explained