how to rename a file and move from one s3 bucket to another

Solution for how to rename a file and move from one s3 bucket to another
is Given Below:

I am using this command but unable to rename and move a file from one s3 folder to another

I want to rename this file as well as move

Here anagaza.csv000 is the file I want to rename and move it to movedData folder with the name angaza.csv

Once I move the file I also want a more generic approach where instead of file name like anagaza.csv000 I could use wildcard like anaga*.* or “wildcard.csv*” something like that but my destination should have the name I choose to give which is angaza.csv

aws s3 --recursive mv 
s3://mygluecrawlerbucket/angaza_accounts/movedData/angaza.csv --profile default

You can generate new object names with shell script (mv or rename) and after that rename in S3 with s3 mv one by one.
For renaming the name of objects, you need to write regex or somethig by yourself. For renaming with regex, this SO will help.

Here is I used.

list_objects=$(aws s3 ls s3://oldbucket | awk '{print $4}')

for old_object_name in $list_objects; do
    new_object_name=$(...) # mv or rename
    aws s3 mv s3://oldbucket/$old_object_name s3://newbucket/$new_object_name