the Rainbow Networks
+++eXy FFA
Map: ztn3dm1
Players: 2 / 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: My Account
02: The golden pot
03: Home
04: Maps
05: The golden pot
06: The golden pot
07: My Account
08: The golden pot
09: Maps
10: The golden pot
11: The golden pot
12: Maps
13: Maps
14: The golden pot
15: The golden pot
16: Maps
17: The golden pot
18: The golden pot
19: The golden pot
20: The golden pot
21: My Account
22: The golden pot
23: The golden pot
24: The golden pot
25: My Account
26: Maps
27: Maps
28: Servers & High Scores
29: My Account
30: The golden pot
31: The golden pot
32: Maps
33: My Account

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