(May-05-2020, 09:49 PM)senaint Wrote: I have no idea why I thought regex would be the solution to this.it could, but str.split() looks simpler
as I said in my first post - iterate over it
import json import os rootfile = r'C:\\Users\\homer\\dumps\\cosmodb-sample.json' with open(rootfile,'r') as file: json_data = json.load(file) for item in json_data: item['id'] = item['id'].split('-$')[0] print(item['id'])
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs