1 |
let's say you have a listing like this in a file name list.txt: |
2 |
|
3 |
aaa bbb |
4 |
aaa bbb |
5 |
aaa bbb |
6 |
aaa bbb |
7 |
aaa bbb |
8 |
|
9 |
if you wanna print the "bbb" column, you just have to do like this: |
10 |
|
11 |
cat list.txt | awk '{ print $2 }' |
12 |
|
13 |
if the listing is like this: |
14 |
|
15 |
aaa;bbb |
16 |
aaa;bbb |
17 |
aaa;bbb |
18 |
aaa;bbb |
19 |
aaa;bbb |
20 |
|
21 |
then you do: |
22 |
|
23 |
cat list.txt | awk -F';' '{ print $2 }' |
24 |
|
25 |
and so on. I sugest you read awk and gawk man pages for more info. |
26 |
they are very complete. |
27 |
|
28 |
regards, claudio. |
29 |
|
30 |
|
31 |
On 3/24/06, Sascha Lucas <sascha.lucas@×××××××××××××××××.de> wrote: |
32 |
> Hi list, |
33 |
> |
34 |
> I want the awk analogon for "cut -f2-", which prints fields #2 to #n. Is |
35 |
> this possible? |
36 |
> |
37 |
> awk '{print $2???}' |
38 |
> |
39 |
> TIA, |
40 |
> |
41 |
> Sascha. |
42 |
> |
43 |
> -- |
44 |
> gentoo-user@g.o mailing list |
45 |
> |
46 |
> |
47 |
|
48 |
-- |
49 |
gentoo-user@g.o mailing list |