import pandas as pd
df = pd.read_csv('/sample.txt', header=None, skiprows=[0],skipfooter=1, delimiter = '|', names=["COL1","COL2","COL3"])
#ds = df.iloc[1:].iloc[:-1]
spark.createDataFrame(df.astype(str)).createOrReplaceTempView('BaseCode')
Modified on: Wed, 15 Dec, 2021 at 5:30 AM
import pandas as pd
df = pd.read_csv('/sample.txt', header=None, skiprows=[0],skipfooter=1, delimiter = '|', names=["COL1","COL2","COL3"])
#ds = df.iloc[1:].iloc[:-1]
spark.createDataFrame(df.astype(str)).createOrReplaceTempView('BaseCode')
Did you find it helpful? Yes No
Send feedback