Using sed, tr, or grep, Convert Letters to Numbers

Posted on 2005-04-28
Last Modified: 2013-12-26
      Substitute for each letter its numeric alphabetic position. That is A goes to 1, Z goes to 26 etc. Lower case letters are also changed.

Any ideas?

Question by:vupadhya
    LVL 51

    Expert Comment

    sounds like a homework assignment, could you please post what you have done so far
    LVL 2

    Expert Comment

    man tr
    LVL 2

    Expert Comment

    and just for fun, man sed and man grep too.
    LVL 84

    Accepted Solution

    tr won't handle translating 'Z' to '26'
    It's possible with sed, but easier with  awk or perl

    Featured Post

    Maximize Your Threat Intelligence Reporting

    Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

    Join & Write a Comment

    Suggested Solutions

    Title # Comments Views Activity
    mixString challenge 36 92
    dog bark java program 15 69
    if loop in java 3 99
    move a line in eclipse 3 45
    In this article, I'll describe -- and show pictures of -- some of the significant additions that have been made available to programmers in the MFC Feature Pack for Visual C++ 2008.  These same feature are in the MFC libraries that come with Visual …
    Introduction: Load and Save to file, Document-View interaction inside the SDI. Continuing from the second article about sudoku.   Open the project in visual studio. From the class view select CSudokuDoc and double click to open the header …
    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.
    how to add IIS SMTP to handle application/Scanner relays into office 365.

    733 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

    24 Experts available now in Live!

    Get 1:1 Help Now