The UNIX and Linux Forums  


Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
.
google unix.com



UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
select particular column and creat a new file with comma iammitra Shell Programming and Scripting 4 05-05-2009 04:44 AM
select a column alfreale Shell Programming and Scripting 2 06-16-2008 07:45 AM
Select Record based on First Column mgirinath Shell Programming and Scripting 8 07-16-2007 02:38 AM
awk to select a column from particular line number mab_arif16 Shell Programming and Scripting 4 05-08-2006 06:26 AM
Select records based on search criteria on first column shashi_kiran_v UNIX for Dummies Questions & Answers 2 12-02-2005 01:49 PM

Reply
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 10-29-2009
kaushik02018 kaushik02018 is offline
Registered User
  
 

Join Date: Dec 2008
Posts: 27
Smile select first column of file

Hi,
Following is my file output

247 Sleep 25439 NULL
259 Sleep 25460 NULL
277 Sleep 15274 NULL
361 Sleep 2 NULL
362 Sleep 202 NULL

I want to select only first column to other file

How can we do this?
  #2 (permalink)  
Old 10-29-2009
Smiling Dragon's Avatar
Smiling Dragon Smiling Dragon is offline Forum Advisor  
Disorganised User
  
 

Join Date: Nov 2007
Location: New Zealand
Posts: 922

Code:
cut -f 1 < output > otherfile

or

Code:
awk '{ print $1 }' output > otherfile

  #3 (permalink)  
Old 10-29-2009
kaushik02018 kaushik02018 is offline
Registered User
  
 

Join Date: Dec 2008
Posts: 27
Smile

Quote:
Originally Posted by Smiling Dragon View Post
Code:
cut -f 1 < output > otherfile

or

Code:
awk '{ print $1 }' output > otherfile
Thanks I got my answer
Reply

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 08:19 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0