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

  Unix/Linux 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 Linux or Unix Question    
 
Thread Tools Search this Thread Display Modes
    #1  
Old Unix and Linux 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 Unix and Linux 01-18-2013
balajesuri's Unix or Linux Image
balajesuri balajesuri is offline Forum Advisor  
#! /bin/bash
 
Join Date: Apr 2009
Last Activity: 4 March 2015, 10:05 PM EST
Location: India
Posts: 1,856
Thanks: 27
Thanked 532 Times in 510 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 Unix and Linux 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 Linux or Unix Question

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Unix or Linux Image 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 06:28 PM.