I have been working on writing a script to filter down data from a CSV file being dropped in a windows shared server. The problem lies with it stating that it cannot find the file, despite it existing.
I am running this on Linux (Ubuntu) and I have the drive mapped in the system with samba. The complete file path in samba is:
smb://serverip/csv%20files/rlog.csv
In the Windows server, there are is a space between csv
and rlog
Originally it was not seeing the location because \r
is a special character and I found that adding r
before the string makes it literal.
What I have so far as a script is:
import numpy as np
import pandas as pd
PATH = r"\\serverip\csv%20files\rlog.csv"
data_file = pd.read_csv(PATH, sep="|")
print(data_file)
I have tried the PATH variable with r"\\serverip\csv files\rlog.csv"
, r"\\serverip\csv%20files\rlog.csv"
and smb://serverip/csv%20files/rlog.csv
, but they both output the same error.
It outputs the error IOError: File "\\serverip\csv%20files\rlog.csv" does not exist
despite it being in the directory and existing.
Is there a special way to do this? Because I am at a loss.