I am trying to read a file from S3, which has the following content stored in it:
{"empID":{"n":"7"},"name":{"s":"NewEntry"}}
{"empID":{"n":"3"},"name":{"s":"manish"}}
{"empID":{"n":"2"},"name":{"s":"mandeep"}}
{"empID":{"n":"4"},"name":{"s":"Vikas"}}
{"empID":{"n":"1"},"name":{"s":"babbar"}}
I want to iterate over each and every object and do some some processing on them.
I am taking reference from this code:
import json
import boto3
s3_obj =boto3.client('s3')
s3_clientobj = s3_obj.get_object(Bucket='dane-fetterman-bucket', Key='mydata.json')
s3_clientdata = s3_clientobj['Body'].read().decode('utf-8')
print("printing s3_clientdata")
print(s3_clientdata)
print(type(s3_clientdata))
s3clientlist=json.loads(s3_clientdata)
print("json loaded data")
print(s3clientlist)
print(type(s3clientlist))
but there is not any "Body" attribute in the file. Can i get some points to do the desired stuff.