I get the desired output with the following code:
row='s3://bucket-name/qwe/2022/02/24/qwe.csv'
new_row = row.split('s3://bucket-name/')[1]
print(new_row)
qwe/2022/02/24/qwe.csv
I want to achieve this while having the bucket name saved in a variable, like this:
bucket_name="bucket-name"
new_row = row.split('s3://'+bucket_name+'/')[1]
This doesn't work (says invalid syntax).
Is there another way I can define this or will I have to use a different function to split?
