inputfile has 3 columns
SCHEMA.TAB1 COL1 LENGTH
SCHEMA.TAB2 COL2 LENGTH.
If i use awk on the above inputfile
awk '{print $1}' inputfile.The out put will be
SCHEMA.TAB1
SCHEMA.TAB2.
But from the above output i need to delete SCHEMA. i.e i don't want the string "SCHEMA." should display in output.Can some body help me how to code that ?
What should be the desired output?
Just
TAB1 COL1 LENGTH
TAB2 COL1 LENGTH
i.e string "SCHEMA." should not be display in output
awk -F\. '{print $2}' file
yes its working fine.Can i know the meaning of this statement?
with out giving $3, and $1 in the ouput how come the SCHEMA. string got depriciated?
rocking77:
yes its working fine.Can i know the meaning of this statement?
with out giving $3, and $1 in the ouput how come the SCHEMA. string got depriciated?
With a dot as fieldseparator (-F\.) the second field is the part after the first dot (untill the next dot).
kurumi
February 2, 2011, 10:26am
7
$ ruby -ne 'print gsub(/^.[^.]*\./,"")' file
$ ruby -F"\." -ane 'puts $F[1]' file