I have a dir named, dir = "/cpfs/data/user/yanxin/data/verylongvideos/ytbjsonl/part" I…
- User
I have a dir named, dir = "/cpfs/data/user/yanxin/data/very_longvideos/ytb_jsonl/part" I have multiple files under it, they are named with ytb_100k_yi6b_filter_450f_psnr0.5_ssim0.5_flow0.2_lpips_all_part?_gpt4o.jsonl. and the ? is a random digit number. rename them into .json
- Assistant
To rename all files in your directory that match the pattern and change their extension from
.jsonlto.json, you can use a simple shell script or command-line loop. Here's how you can do it:-
Open your terminal.
-
Navigate to your target directory:
cd /cpfs/data/user/yanxin/data/very_longvideos/ytb_jsonl/part -
Execute the following loop to rename the files:
-