On Wed, Sep 7, 2011 at 7:43 AM, lina wrote:
> (...)
> I wish the fied 2 from file 2 arranged the same sequence as the field
> 2 of file 1.
>
> Thanks
>
> (...)
>
For very general scripting questions like these, prefer the comp.unix.shell
group, this list is primarily about bugs in bash.
File 1:
1 C1
2 O1
3 C2
4 C3
5 H3
6 C7
7 O2
8 H22
9 C6
10 H61
11 C5
12 H5
13 C4
14 C8
15 C9
16 C10
17 O3
18 C11
19 C12
20 O4
21 C13
22 C14
23 C15
24 C20
25 H20
26 C16
27 H16
28 C17
29 H17
30 C18
31 O6
32 H62
33 C19
34 O5
35 C21
File 2:
3 H16
4 H5
6 H61
7 H17
9 H20
12 H3
13 C1
14 O1
15 C2
16 C3
17
Hi,
How can I extract the array (a b c) out from file 1
10 a
11 b
12 c
and sort the file 2:
which b
whyc
what a
into the form of
what a
which b
why c
--
Best Regards,
lina