The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Compare selected columns from a file and print difference kingpeejay Shell Programming and Scripting 4 07-20-2009 02:01 AM
perl script to print to values in rows and columns nogu0001 Shell Programming and Scripting 3 02-22-2009 04:30 PM
Script to place selected columns from a group of files side by side in a new file ks_reddy Shell Programming and Scripting 8 02-12-2009 12:09 PM
AWK script to print all the columns excpet the one specified kn.naresh Shell Programming and Scripting 3 05-22-2008 08:34 AM
selected columns exctract ashokkumar83 UNIX for Dummies Questions & Answers 2 12-12-2007 09:05 AM

 
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
Prev Previous Post   Next Post Next
  #1 (permalink)  
Old 08-25-2009
ks_reddy ks_reddy is offline
Registered User
  
 

Join Date: Feb 2009
Posts: 24
shell script(Preferably awk or sed) to print selected number of columns from each row

Hi Experts,

The question may look very silly by seeing the title, but please have a look at it clearly.

I have a text file where the first 5 columns in each row were supposed to be attributes of a sample(like sample name, number, status etc) and the next 25 columns are parameters on which I am interested in looking at.

But the problem is for some of the rows in the text file we don't have all the 5 columns(first 5 fields). Then the parameter column will be left offset by 1 or 2 columns etc depending on the number of missing attribute columns.

So I decided to print the last 25 columns starting from the last column so that for each sample I get my required parameters from which I need make some plots.

I need the script preferable using awk, sed and grep.

Many thanks friends..
 

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 09:07 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