-
-
Save brandonstephens/4725792 to your computer and use it in GitHub Desktop.
Bash function that concatenates all txt files with filename into a single txt file.
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
# place this in your aliases or bash profile | |
# cd to the directory of .txt files and run the command 'melt' | |
function melt(){ | |
FILE=_meltOutput.txt | |
rm -f $FILE | |
for f in *.txt | |
do | |
printf "$f - " | cat >> $FILE | |
cat $f | cat >> $FILE | |
echo >> $FILE | |
done | |
open $FILE | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment