I need to open and work on data coming in a text file with python. The file will be stored in the Azure Blob storage or Azure file share.
However, my question is can I use the same modules and functions like os.chdir() and read_fwf() I was using in windows? The code I wanted to run:
import pandas as pd
import os
os.chdir( file_path)
df=pd.read_fwf(filename)
I want to be able to run this code and file_path would be a directory in Azure blob.
Please let me know if it's possible. If you have a better idea where the file can be stored please share.
Thanks,
As far as I know,
os.chdir(path)
can only operate on local files. If you want to move files from storage to local, you can refer to the following code:pandas.read_fwf
can read blob directly from storage using URL:For example: