LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 10-25-2013, 04:39 AM   #1
sryzdn
Member
 
Registered: Feb 2013
Posts: 274

Rep: Reputation: 9
awk ceratain columns


Hi,

I have a file like this:
Code:
   403    225.06   -4551.46536   -4551.49338      48.123      -7.189
   425    233.91   -4551.45974   -4551.49197      48.170     -12.768
   426    237.36   -4551.46091   -4551.49196      48.170     -12.855
   427    237.76   -4551.46095   -4551.49198      48.170     -13.049
   428    235.17   -4551.45973   -4551.49187      48.169     -12.988
   429    229.53   -4551.45741   -4551.49181      48.168     -13.303
   430    221.18   -4551.45413   -4551.49182      48.166     -13.296
   431    210.47   -4551.44994   -4551.49181      48.164     -13.467
   432    197.96   -4551.44505   -4551.49178      48.161     -12.623
   433    184.32   -4551.43978   -4551.49179      48.158     -12.222
   434    170.19   -4551.43431   -4551.49176      48.154     -11.793

How can I print columns 1 and 4 to another file?
 
Old 10-25-2013, 04:49 AM   #2
pwc101
Senior Member
 
Registered: Oct 2005
Location: UK
Distribution: Slackware
Posts: 1,847

Rep: Reputation: 128Reputation: 128
Code:
awk '{print $1,$4}' inputfile.txt > outputfile.txt
 
1 members found this post helpful.
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] help on awk contain between two columns phpshell Programming 10 04-17-2013 12:33 AM
creating columns with awk? verse123 Linux - Newbie 6 11-09-2011 01:50 AM
[SOLVED] AWK: add columns while keep format for other columns cristalp Programming 3 10-13-2011 06:14 AM
extracting columns with awk gav251 Programming 7 03-10-2011 08:40 AM
Using awk to switch columns bioinformatics_guy Linux - Newbie 3 10-30-2008 09:50 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 05:29 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration