ACCESS=config.s3bucket['aws_access_key']
SECRET=config.s3bucket['aws_secret_key']
url_e=config.s3bucket['url']
client = boto3.client(service_name="s3", region_name="us-east-1",
endpoint_url=url_e,
verify=False,
aws_access_key_id = ACCESS,
aws_secret_access_key= SECRET)
client.download_file('bucketname','downloadfile.csv','downloadfile.csv')
print ("Downloading object %s from bucket %s" % ('downloadfile.csv','bucketname'))
#step1: file split into two files
if os.path.exists('11.csv'):
print('File is previously present and have been deleted !')
os.remove('11.csv')
if os.path.exists('22.csv'):
print('File is previously present and have been deleted !')
os.remove('22.csv')
condition = 0
#lines=0
header = []
with open('downloadfile.csv', 'r', encoding='UTF-8') as file:
#with open(myfile, 'r', encoding='UTF-8') as file:
for lines in file:
if condition ==0:
#if lines ==0:
header = lines.strip('\n').split(',')
#elif lines <= 2:
elif condition < 2:
Murali.