Find the answer to your Linux question:
Results 1 to 2 of 2
Hi, I'm new in here so I don't know if this is the right place to ask or not; therefore, plz forgive me if it's not. Anyway, here's my question: ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Jan 2006
    Posts
    1

    Help with Regular Expression


    Hi, I'm new in here so I don't know if this is the right place to ask or not; therefore, plz forgive me if it's not. Anyway, here's my question:

    Let's say I have this line:

    csu12345@mail.clayton.edu:Johnoe:A

    how can I change it into something like this in VIM:

    DAJ12345oe A John

    Thanks for your help

  2. #2
    Linux Guru Cabhan's Avatar
    Join Date
    Jan 2005
    Location
    Seattle, WA, USA
    Posts
    3,252
    Well, it depends, are you hardcoding this in or are you pulling out letters and switching stuff around.

    If the former, then all you'd need is a very simple:
    Code:
    :s/csu12345@mail.clayton.edu:Johnoe:A/DAJ12345oeA.John
    But if the latter, then you need to explain where you're getting all those letters from.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •