while copying the file path from local to Google Cloud Platform, the path at local is in retail_db\categories\part-00000 format whereas GCP is accepting format as retail_db/categories/part-00000
I have successfully copied the path to GCP but it is showing like this:
gs://kiretail/pythondemo/retail_db\categories\part-00000
How to replace this backward slash with forward slash?
tried using this:
path.replace("\\", "/")
But still I am missing something. Below is the code to copy filepath to gcp:
files = filter(lambda item: os.path.isfile(item), items)
bucket = gsclient.get_bucket('kiretail')
for file in files:
print(f'Uploading file {file}')
blob_suffix = '/'.join(file.split('/')[3:])
blob_name = f'{tgt_base_dir}/{blob_suffix}'
blob = bucket.blob(blob_name)
blob.upload_from_filename(file)
Below is the code I tried:
for x in blobs:
replace("\\", "/")