Results 1 to 12 of 12

Thread: Notepad Help

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1

    Default Notepad Help

    (if wrong place please move)
    I'm trying to edit a text document that allows me to find and replace lines that have different #'s:

    IE:
    Artillery Brigade 253
    Artillery Brigade 254
    Artillery Brigade 255
    Artillery Brigade 256
    Artillery Brigade 257
    Artillery Brigade 258

    to:
    253th Artillery Brigade
    254th Artillery Brigade
    255th Artillery Brigade
    256th Artillery Brigade
    257th Artillery Brigade
    258th Artillery Brigade

    Do I need a different program than notepad?

  2. #2
    Akar's Avatar I am not a clever man
    Join Date
    Jun 2010
    Location
    a 7/11 parking lot with Patron and LaCroix
    Posts
    20,034
    Blog Entries
    2

    Default Re: Notepad Help

    I suggest notepad++, its far better than notepad for editing files.

  3. #3

    Default Re: Notepad Help

    Thank You. That is a very good program. Can someone explain how to replace different #s?

  4. #4
    Thoragoros's Avatar Citizen
    Join Date
    Jan 2006
    Location
    New York
    Posts
    4,822

    Default Re: Notepad Help

    As Aka said, Notepad+ is a much better choice for anything code/scripting/programming related.

    Also, Notepade+ is a comparatively easy to use tool if you are new to this.

    NOTE

    For all things techy, you might want to try the Basement
    Founder of The Great War - A WWI Mod, Creator of Thorized - Napoleon: Total Combat

    Where Gods Walk Among Men
    The Line of Thor
    Patron of: Bethencourt, Hip63, m_1512

    Under the Patronage of Captain Blackadder, Member of the Legion of Rahl.

  5. #5

    Default Re: Notepad Help

    Can a mod move this to the basement (along with my computer and bed )

  6. #6
    mp0295's Avatar Vicarius
    Join Date
    Jul 2008
    Location
    Long island, NY
    Posts
    2,836

    Default Re: Notepad Help

    I dunno why, but I lol'd when I saw the title. Probably because notepad is one of the simplest programs in existence


    Track & Field = Life
    http://www.last.fm/user/mp0295

  7. #7

    Default Re: Notepad Help

    Quote Originally Posted by mp0295 View Post
    I dunno why, but I lol'd when I saw the title. Probably because notepad is one of the simplest programs in existence
    I know. The file opens in notepad by default and I never really used other programs. Notepad is too simple, it can't do this simple task.

  8. #8

    Default Re: Notepad Help

    Can A mod please move this to the basement?

  9. #9
    Legio's Avatar EMPRESS OF ALL THINGS
    Moderator Emeritus Content Emeritus

    Join Date
    Mar 2008
    Location
    Chlοėtopia
    Posts
    43,774

    Default Re: Notepad Help

    Moved to the Basement.

  10. #10

    Default Re: Notepad Help

    You can't do that in either notepad or notepad++ as far as i know you can bulk replace multiple occurrences of the same text like in the OP you can replace all the multiple occurrences of the word "Artillery Brigade" with something you like with the replace option (hot key CTRL+H). But you can't do that like you desire, that is move the different number(not identical) in front of them and then add "th".

  11. #11
    irishron's Avatar Cura Palatii
    Moderator Emeritus

    Join Date
    Feb 2005
    Location
    Cirith Ungol
    Posts
    47,023

    Default Re: Notepad Help

    It looks more like spreadsheet stuff but you need a macro to do it.
    By the time you figure out a macro in something like Excel, you would have them done just changing them one at a time in Notepad.

  12. #12

    Default Re: Notepad Help

    The search and replace function in Notepad++ lets you do a lot of stuff, including regular expressions. It's very powerful. But it cannot, by design, deal with a variable that changes from expression to expression. So the easiest way probably is to use a spreadsheet, as the others suggested, using the autofill functions: Create one column with the number, one with "th Artillery Brigade", and merge the two. Then you need to do a replace using "1th" to be replaced with "1st" and so on. No need for a macro, I think. Maybe your spreadsheet can automatically show numbers as ordinals, e.g. adding "st", "nd", "rd" or "th" as appropriate, so you can skip the replace task. The more elegant way is to script it, e.g. using Python.
    Last edited by eisenkopf; May 05, 2011 at 10:31 AM.
    "The cheapest form of pride however is national pride. For it reveals in the one thus afflicted the lack of individual qualities of which he could be proud, while he would not otherwise reach for what he shares with so many millions. He who possesses significant personal merits will rather recognise the defects of his own nation, as he has them constantly before his eyes, most clearly. But that poor blighter who has nothing in the world of which he can be proud, latches onto the last means of being proud, the nation to which he belongs to. Thus he recovers and is now in gratitude ready to defend with hands and feet all errors and follies which are its own."-- Arthur Schopenhauer

Posting Permissions

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