'awk' is a very useful shell command (also a program language) in linux (unix). You split one text line by it. For example, for the line
line="aa, b c , d , f "
what you can do in shell command (bash) is
echo $line|awk -F "," '{print $1 $2 $3 $4}' # to get different columns separated by ","
However, if you wanna split one line with multi-separators, then you could do in the way, for example,
$ line="aa, bb_ ccd: ee"
$ echo $line |awk -F ",|_|:" '{print $1$2$3}'
Note here "|" will do logic "OR" of all separators. This is similar 'egrep'. If you want to grep multi key words, then you could do in the same way (which has been addressed in my other blog, just search grep ).
Saturday, November 8, 2008
Linux:shell: awk: multiple separators
Thursday, October 23, 2008
Latex: subfigure: how to get rid of 'counter' of subcaption
The subfigure 's tutorial
If you want to get rid of 'counter' in front of your sub-captions, use to redefine the command: \thesubfigure by:
\renewcommand*{\thesubfigure}{}
(originally one in subfigure.sty is
\renewcommand*{\thesubfigure}{(\alph{subfigure})}
)
Tuesday, October 14, 2008
Linux:command: du and quota
My disk quota is full on my account at Fermilab (.../home/zhiyil/desktop/...). So I have to clean to get more rooms to store files to SAM. Use the command:
du -s * .[a-zA-Z]* | sort -n
get an idea of which file is the largest one so that you could deal with them.
Thursday, October 9, 2008
Linux:command:shell: diff
One of layouts of printout of the command 'diff' is called: --side-by-side or -y which is also useful. Change the column width, just use
- -W columns
- --width=columns
diff --side-by-side -W 130 file1.txt file2.txt
Tuesday, October 7, 2008
Thursday, September 18, 2008
CVS: update
If you want to checkout the newest version of the package, then do
cd
cvs update .
or
cvs update -A FileWhatYouWantToCheckOut
If you want to get an idea of the difference:
cvs diff
statistics:chi-square calculator
A page to calculate chi-square.
http://www.stat.tamu.edu/~west/applets/chisqdemo.html
given freedom.
