#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2003
    Posts
    3
    Rep 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.
  2. #2
  3. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2003
    Location
    India
    Posts
    7
    Rep 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
  4. #3
  5. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2003
    Posts
    3
    Rep 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>
  6. #4
  7. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2003
    Posts
    3
    Rep Power
    0
    Sorry, i mentioned my mail id wrongly. Spelling of hotmail is incorrect.
    its <thalloory_s@hotmail.com>

IMN logo majestic logo threadwatch logo seochat tools logo