Posted by The TechMentor in Journal
on May 23rd, 2014
# cat * | grep ^T > Total.txt # cat Total.txt | sed 's/T //' > Tstriped.txt # grep -v '^Tr' Tstriped.txt > Total.txt # cat Total.txt | sed -e 's/ 1999//' -e 's/ Sun//' -e 's/ Mon//' -e 's/ Tue//' -e 's/ Wed//' -e 's/ Thu//' -e 's/ Fri//' -e 's/ Sat//' > Finished.txt # cat Finished.txt | sed -e 's/^\(.\{12\}\)/\1,/' -e 's/^\(.\{26\}\)/\1,/' -e 's/ ,/,/g' > Final.csv Extract Only Track Info Remove Track Label Remove Beginning and End lines Get rid of Days and Year Add Commas
Posted by The TechMentor in BASH, Scripts
on May 20th, 2014
If you spend much time at all coding or scripting you realize that you often do some of the same things over and over. That’s where functions and libraries come in. Having a library of commonly used functions handy helps speedup the coding process quite a bit. Usually I prefer to use the best tool for the job. That means using Perl, PHP, C, C++, BASH, or any other language suited for the task. However, lately I’ve been using BASH more than usual. Primarily because it’s pretty much guaranteed to be on just about ever, non Windows, system that I touch. Unfortunately, while I have an...