Display/Cut the characters based on match | Unix Linux Forums | UNIX for Dummies Questions & Answers

  Go Back    


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 !!

Display/Cut the characters based on match

UNIX for Dummies Questions & Answers


Closed Thread    
 
Thread Tools Search this Thread Display Modes
    #1  
Old 03-03-2013
nsuresh316 nsuresh316 is offline
Registered User
 
Join Date: Jun 2012
Last Activity: 21 June 2013, 6:35 AM EDT
Posts: 24
Thanks: 11
Thanked 0 Times in 0 Posts
Display/Cut the characters based on match

I have input file like this

Code:
update tablename set column1='ABC',column2='BBC' where columnx=1 and columny=100 and columnz='10000001'
update tablename set column1='ABC',column2='BBC',column3='CBC' where columnx=1 and columny=100 and columnz='10000002'
update tablename set column1='ABC' where columnx=1 and columny=100 and columnz='10000003'
update tablename set  column1='ABC',column2='BBC',column3='EBC',column4='GBC' where columnx=1  and columny=100 and columnz='10000004'
update tablename set column1='ABC',column2='BBC',column3='FBC' where columnx=1 and columny=100 and columnz='10000005'

I need like this

Code:
10000001
10000002
10000003
10000004
10000005


Code:
My shell is csh

Sponsored Links
    #2  
Old 03-03-2013
anbu23's Avatar
anbu23 anbu23 is offline Forum Advisor  
Advisor
 
Join Date: Mar 2006
Last Activity: 21 November 2014, 4:45 AM EST
Location: Bangalore,India
Posts: 2,091
Thanks: 12
Thanked 131 Times in 126 Posts

Code:
awk -F\' ' { print $(NF-1) } ' file

The Following User Says Thank You to anbu23 For This Useful Post:
nsuresh316 (03-03-2013)
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
Display n lines before match found nsuresh316 UNIX for Dummies Questions & Answers 3 06-25-2012 10:04 AM
awk display the match and 2 lines after the match is found. eurouno UNIX for Dummies Questions & Answers 4 02-03-2012 09:16 PM
Cut last 7 characters of a variable kblawson14 Shell Programming and Scripting 5 12-16-2010 04:53 PM
Cut the last 15 characters off svajhala Shell Programming and Scripting 5 09-01-2010 02:36 AM
regex - display all occurrences of match danmauer UNIX for Dummies Questions & Answers 18 02-17-2009 11:53 AM



All times are GMT -4. The time now is 04:02 PM.