Want to remove the lasts from line in three txt file which is present into S3 bucket file size is more that 4 GB how to automate that using lambda

+1 vote
I Want to remove the lasts from a line in three .txt file which is present into a S3 bucket and keep the three .txt files in the same s3 bucket (file size is more than 4 GB) how to automate that using lambda!!! using boto3
Jun 7, 2020 in AWS by Shubh
• 150 points

edited Jun 8, 2020 by MD 1,674 views

1 answer to this question.

0 votes

Hi@Shubh,

According to my knowledge,  you can't edit s3 files directly in s3. But you can sync your bucket locally and upload your changes to the s3 bucket.

  • First, sync your file from the s3 bucket to your local system.
C:\Users\NADIM AKTHAR\Desktop\New folder>aws s3 sync s3://bucketnadim bucket.txt
download: s3://bucketnadim/bucket.txt to bucket.txt\bucket.txt
download: s3://bucketnadim/123.jpg to bucket.txt\123.jpg
  • Then modify your file and upload it to the s3 bucket.
C:\Users\NADIM AKTHAR\Desktop\New folder>aws s3 sync bucket.txt s3://bucketnadim
upload: bucket.txt\bucket.txt to s3://bucketnadim/bucket.txt
answered Jun 8, 2020 by MD
• 95,460 points

Related Questions In AWS

0 votes
1 answer

How to download the latest file in a S3 bucket using AWS CLI?

You can use the below command $ aws ...READ MORE

answered Sep 6, 2018 in AWS by Archana
• 4,170 points
19,878 views
0 votes
0 answers

I want to get file name from key in S3 bucket wanted to read single file from list of file present in bucket

1 <class 'boto.s3.key.Key'> <Key: numbers-email, staging/Procured_Numbers_Status/procured_numbers_status_2019-05-15:06:09:04.csv> I ...READ MORE

May 15, 2019 in AWS by anonymous
6,968 views
+1 vote
1 answer
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP