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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
akkibuddy7
Helper I
Helper I

Load txt pole (|) separated file to delta table

fabric is giving error when loading txt file with pole separated to delta table. any idea how to load such files?

 

1 ACCEPTED SOLUTION
nilendraFabric
Super User
Super User

Hello @akkibuddy7 

 

You cannot use load to table option with | delimited files. That option is for csv

 

you have to use spark notebook to load to tables

 

df = spark.read.format("csv") \
.option("header", "true") \ # Set to 'false' if no header row exists
.option("delimiter", "|") \
.load("/path/to/your/file.txt")

 

df.write.format("delta").mode("overwrite").saveAsTable("table_name")

If this is helpful please accept the answer and give kudos

View solution in original post

3 REPLIES 3
nilendraFabric
Super User
Super User

Hello @akkibuddy7 

 

You cannot use load to table option with | delimited files. That option is for csv

 

you have to use spark notebook to load to tables

 

df = spark.read.format("csv") \
.option("header", "true") \ # Set to 'false' if no header row exists
.option("delimiter", "|") \
.load("/path/to/your/file.txt")

 

df.write.format("delta").mode("overwrite").saveAsTable("table_name")

If this is helpful please accept the answer and give kudos

is there any approch for incremental data? if S3 txt gets updated , will have to again run the dataframe to pull updated table and that's bit tedious job. 

Realized few min back the same appoch ! but your code solves the issue Thanks again!

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Fabric Update Carousel

Fabric Monthly Update - September 2025

Check out the September 2025 Fabric update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Kudoed Authors