AWK ( Print field before last)

Posted on 2005-05-04
Last Modified: 2013-12-26
I can print out the last field such as  awk '{ print $NF }'

how can i print out the last field and the Next to last field.......
Question by:bt707

    Author Comment

    looks like i got it,

    awk '{print $NF, $(NF-1)}'
    LVL 51

    Accepted Solution

    congratulations for your own solution ;-)

    I'll refund your 500 points.

    {{ ahoffmann EE Page Editor }}

    Author Comment

    Thanks, I didn't know how to close this.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Suggested Solutions

    Title # Comments Views Activity
    Perl Awk Need Help 3 85
    Replacement selected text 2 45
    iSeries DB2 Query 2 66
    changeXy challenge 13 40
    Introduction: Ownerdraw of the grid button.  A singleton class implentation and usage. Continuing from the fifth article about sudoku.   Open the project in visual studio. Go to the class view – CGridButton should be visible as a class.  R…
    If you use Adobe Reader X it is possible you can't open OLE PDF documents in the standard. The reason is the 'save box mode' in adobe reader X. Many people think the protected Mode of adobe reader x is only to stop the write access. But this fe…
    This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
    To add imagery to an HTML email signature, you have two options available to you. You can either add a logo/image by embedding it directly into the signature or hosting it externally and linking to it. The vast majority of email clients display l…

    761 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    8 Experts available now in Live!

    Get 1:1 Help Now