Cut command in a matrix | Unix Linux Forums | Shell Programming and Scripting

  Go Back    


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

Cut command in a matrix

Shell Programming and Scripting


Closed Thread    
 
Thread Tools Search this Thread Display Modes
    #1  
Old 01-18-2013
raghur77 raghur77 is offline
Registered User
 
Join Date: Jun 2009
Last Activity: 5 April 2014, 12:43 PM EDT
Posts: 39
Thanks: 0
Thanked 0 Times in 0 Posts
Cut command in a matrix

Hi All,

I want to display row=2 and column=1 where value=10 with the help of cut command, Please advice me

1 2 3 4
5 6 7 8
9 10 11 12
Sponsored Links
    #2  
Old 01-18-2013
balajesuri's Avatar
balajesuri balajesuri is offline Forum Advisor  
#! /bin/bash
 
Join Date: Apr 2009
Last Activity: 23 November 2014, 2:06 AM EST
Location: India
Posts: 1,833
Thanks: 25
Thanked 526 Times in 505 Posts

Code:
sed -n 3p file | cut -d' ' -f2

If this doesn't suit your requirement, then please provide more information. More info on data samples, logic and desired output would help.
Sponsored Links
    #3  
Old 01-18-2013
raghur77 raghur77 is offline
Registered User
 
Join Date: Jun 2009
Last Activity: 5 April 2014, 12:43 PM EDT
Posts: 39
Thanks: 0
Thanked 0 Times in 0 Posts
thank you balajesuri , it works
Sponsored Links
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
How to convert full data matrix to linearised left data matrix? evoll Ubuntu 8 06-03-2011 12:09 PM
Cut Command error cut: Bad range dgmm Shell Programming and Scripting 2 05-22-2011 01:56 PM
Cut and paste data in matrix form dhilipumich Shell Programming and Scripting 7 01-20-2010 07:59 PM
diagonal matrix to square matrix yifangt Shell Programming and Scripting 11 09-12-2009 04:13 PM
Use of Cut Command Puja Sharma AIX 3 03-26-2008 08:49 AM



All times are GMT -4. The time now is 05:50 PM.