the Rainbow Networks
RN|VQ3 DEFRAG
Map: si
Players: 0 / 18

+++eXy FFA
Map: rq3dm4
Players: 3 / 18
The golden pot › RAINBOW NETWORKS › Tech & Support › Help with awk
Help with awk
Something wrong with our servers or your system?
Post new topic   Reply to topic   Printer Friendly Page     Forum IndexTech & Support
View previous topic :: View next topic  
Author Message
kernel_panic
Übergod
Übergod


Joined: Aug 28, 2007
Posts: 751
Location: uk

PostPosted: Thu Feb 28, 2008 5:55 pm    Post subject: Help with awk Reply with quote

Hi

I want to take one column from one file and some other from another one and input them into a third file, e.g:

>cat file A
1
1
1
1

>cat file B
2
2
2
2

If I do: awk '{print $1}' file A > file C ; awk '{print $1}' file B >> file C
I get:
>cat file C
1
1
1
1
2
2
2
2

Whereas I want:
1 2
1 2
1 2

Could somebody help me?

_________________
"Fuelling off topic babble since day 1."
Back to top
View user's profile
kernel_panic
Übergod
Übergod


Joined: Aug 28, 2007
Posts: 751
Location: uk

PostPosted: Thu Feb 28, 2008 6:33 pm    Post subject: Re: Help with awk Reply with quote

It's OK, I found the paste command.

_________________
"Fuelling off topic babble since day 1."
Back to top
View user's profile
jackthompson
Admin
Admin


Joined: Aug 15, 2007
Posts: 1302
Location: Here

PostPosted: Thu Feb 28, 2008 6:37 pm    Post subject: Re: Help with awk Reply with quote

Code::
FILE1=file1.txt
FILE2=file2.txt

for LINE in `seq 0 10000`; do
  tail -n ${LINE} ${FILE1} | line
  tail -n ${LINE} ${FILE2} | line        
done

reads the first 10000 lines from both files...
Back to top
View user's profile
Display posts from previous:   
Post new topic   Reply to topic   Printer Friendly Page     Forum Index -> Tech & Support All times are GMT + 1 Hour
Page 1 of 1


Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Welcome Anonymous


Membership:
Latest: kontol
New Today: 0
New Yesterday: 0
Overall: 355

People Online:
Members: 0
Visitors: 33
Total: 33
Who Is Where:
 Visitors:
01: Maps
02: Rainbow Media
03: Maps
04: The golden pot
05: The golden pot
06: Maps
07: Maps
08: Home
09: Home
10: The golden pot
11: Servers & High Scores
12: Rainbow Media
13: Maps
14: The golden pot
15: The golden pot
16: The golden pot
17: Home
18: Home
19: The golden pot
20: The golden pot
21: Rainbow Media
22: The golden pot
23: The golden pot
24: The golden pot
25: The golden pot
26: The golden pot
27: The golden pot
28: The golden pot
29: Maps
30: The golden pot
31: Home
32: The golden pot
33: The golden pot

Staff Online:

No staff members are online!

The Rainbow Networks website is hosted by JockeTF and Soder on furver.se.

The Rainbow Networks
Interactive software released under GNU GPL, Code Credits, Privacy Policy
Azul theme and related images designed by Jamin