UNIX Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsOperating SystemsUNIX Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now!
  #1  
Old December 11th, 2003, 02:08 AM
sandeept sandeept is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2003
Posts: 3 sandeept User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Smile Doubt in Unix Scripting

Let me put the Q directly.
I have the following set of lines in a file.
1. le.setRetryReq(CComnRqmtRetry::RETRY_EXSTNC);
2. subcpy2(retry_area,i,1,CForiAffiliationErrTyp::AFFILIATION_OTH_ERR);
3. CInteger i = CForiPosnwhichusesXfrAreaRetryTxn::AFFILIATION;

Now, think that, all the above are appearing a file in 3 different lines.
If u carefully observe these lines, there is a scope resolution operator "::", and to its left, there is a class name, and to its right, there is a string in CAPS.
I want to extract both of these. Output can be displayed onto the desktop or to a file.
Please clarify.

Reply With Quote
  #2  
Old January 22nd, 2004, 10:03 PM
ashok_hp ashok_hp is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2003
Location: India
Posts: 7 ashok_hp User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Hi

I have given the script for the input file that you have specified

------------------------------------------------------------------
le.setRetryReq(CComnRqmtRetry::RETRY_EXSTNC);
subcpy2(retry_area,i,1,CForiAffiliationErrTyp::AFFILIATION_OTH_ERR);
CInteger i = CForiPosnwhichusesXfrAreaRetryTxn::AFFILIATION;
-------------------------------------------------------------------

save the above input file as cutx.txt and then apply my script in command prompt to get the desired output class name
and class member ( Right Side string ) .


awk -F" " '{print $NF}' cutx.txt | awk -F"(" '{print $NF}' | awk -F"," '{print $NF}' | sed 's/)//' | sed 's/;//' | sed 's/::/ /'

Thanks
Ashok_hp

Reply With Quote
  #3  
Old January 23rd, 2004, 12:26 AM
sandeept sandeept is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2003
Posts: 3 sandeept User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Thumbs up Thanks

Hi ashok,
thanks for responding. i got the required output from ur script.
can u send me ur mail id. We can be in touch.
my id is <thalloory_s@hotmaill.com>

Reply With Quote
  #4  
Old January 23rd, 2004, 12:28 AM
sandeept sandeept is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2003
Posts: 3 sandeept User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Sorry, i mentioned my mail id wrongly. Spelling of hotmail is incorrect.
its <thalloory_s@hotmail.com>

Reply With Quote
Reply

Viewing: Dev Shed ForumsOperating SystemsUNIX Help > Doubt in Unix Scripting


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway