Welcome to WebmasterWorld Guest from 220.127.116.11
Forum Moderators: bakedjake
After digging, I found bulk file merger. This neat little app managed to merge all my txt log files into one in a matter of seconds.
What a time saver....
cat file1 file2 file3 >bigfile (concatenates a list of files into one file)
cat *.txt >bigfile.txt (same but using wildcarding to list the files)
cat file.txt >>existingfile.txt (concatenating a file to the end of an existing file)
Doing search and replace/text finding type of things are crazy easy.
I'm no expert but I routinely use the two following:
grep -R string *
which looks recursively for 'string' in every file, down into the directory structure. Looking for a bit of code? just type that at the top of the directory and it'll find it for you.
The other one I use is a search and replace:
perl -p -i -e 's/stringa/stringb/g' *
which replaces all occurrences of stringa with stringb. (I think this is called the perl 'pie' or something like that).
a few of these commands with options open up another dimension:
be very (VERY) careful with:
always (ALWAYS) do this first:
then learn these operators:
¦ (that would be the vertical bar which gets converted to a broken bar in this forum - uppercase backslash on a typical keyboard)
that might cover at least 80-90% of your daily needs
if you also learn awk you can do some very sophisticated text processing without writing a program per se.