Created
February 26, 2024 12:02
-
-
Save wittawasw/ec046e536044030215935a97d7a0da43 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Go into every directory 1 level inside current directory | |
for dir in */; do | |
# Move files with extension .parquet from sub-directory to current directory | |
find "$dir" -maxdepth 1 -type f -name "*.parquet" -exec mv -t . {} + | |
done | |
# Rename those files by removing sub-string -parquet- from their names | |
for file in *.parquet; do mv "$file" "${file/-parquet-/}"; done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment