Hi, unix Gurus,
I hit a problem, I want print out a file without print first column. for example:
123 abc cde ...
234 cde def ...
I want to get as following:
abc cde ..
cde def ..
:wall:
anybody can help me out.
Thanks in advance.
Hi, unix Gurus,
I hit a problem, I want print out a file without print first column. for example:
123 abc cde ...
234 cde def ...
I want to get as following:
abc cde ..
cde def ..
:wall:
anybody can help me out.
Thanks in advance.
$ cat sample7.txt
123 abc cde ...
234 cde def ...
$ cut -f3- -d" " <sample7.txt
abc cde ...
cde def ...
You want to look at 'cut'
[mute@geek ~]$ cut -d' ' -f3- file
abc cde ...
cde def ...
Hi, Thanks both of you. the code very close to, but I got little problem.
I have file:
39613 ORA-01400: cannot insert NULL into (AAA)
39653 ORA-01400: cannot insert NULL into (AAA)
39693 ORA-01400: cannot insert NULL into (AAA)
after I exec the code, I got
cannot insert NULL into (AAA)
cannot insert NULL into (AAA)
cannot insert NULL into (AAA)
but I want to get as following:
ORA-01400: cannot insert NULL into (AAA)
ORA-01400: cannot insert NULL into (AAA)
ORA-01400: cannot insert NULL into (AAA)
Thanks in advance
try this perl code. But some how the last column "..." is not printed. I assume you dont need them.
any perl expert can correct my code. I am a beginner. thanks in advance.
while (<INPUT>) {
my ($x, $y, $z, $a) = split (/\s/);
print "$y $z $a\n";}
See if this awk fills your requirement
awk ' {$1=""; print }' input
Regards
Peasant.
perl is a bit much. have a look at the file, is that first " " a TAB?
-d param to cut is the delimiter, -f3- is fields 3 and more. in previous sample, you had 2 spaces before you wanted output. Now maybe you have TAB?
cut -f2-
Hi, neutronscott,
It works, by the way, how can i know it is TAB or space in unix file.
thank you very much
cat -vet myFile
will display tabs as ^I