widged.com
 

Awk Tips

FS

Note that the string is interpreted as a regular expression. It is therefore possible to use FS = ”~np~,[ \t]* [ \t]+~/np~”, to define an universal field separator. The separator is then either a comma followed by zero or many spaces or tabs, or tab(s), or space(s)

/start/, /stop/ {}

Will match all lines beginning with the first line to match the first pattern, and edning with the first subsequent line that matches the second pattern. In other words, it prints all lines between start/stop pairs (included)

Usual code

BEGIN { FS = ","; OFS = "\t"}
{ }
gsub("\"\"", "-", $0)
print $0 > "pars-sy4.spaces"
for(i = 1; i <= length($3); i++)
if(substr($3, i, 1) == "e") 
BEGIN { FS = "\t"; OFS = "\t"}
{
  eof=1
  while (eof == 1) {
    eof=getline < "Bdlex ter"
    orthoBdlex = 
 }
}
 
en/computers/lg/awk/tips.txt · Last modified: 2007/06/03 05:09 (external edit)
 
RSS - Banner by widged, template © 7throot HeadQuarters, 2007