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 6 in AWS by Shubh
• 150 points

edited Jun 8 by MD 120 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 by MD
• 56,480 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,150 points
9,692 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
1,258 views
+3 votes
5 answers

How to move files from amazon ec2 to s3 bucket using command line

Hey, 3 ways you can do this: To ...READ MORE

answered Oct 9, 2018 in AWS by Omkar
• 69,030 points
12,240 views
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer
+1 vote
1 answer