Loading ...
Sorry, an error occurred while loading the content.

22562Re: [NTB] Remove x number of characters from a line of text

Expand Messages
  • Alec Burgess
    May 27, 2012
    • 0 Attachment
      John is of course correct but for the specific case you described -
      space followed by two or 3 digits you want:
      Find=\x20\d{2,3}
      Replace = (i.e. leave empty)
      with regex find turned on.

      For an idea of some of the other things it will do for you:
      Help-Help on Regular Expressions-Syntax Quick Reference


      On 2012-05-27 22:47, John Shotsky wrote:
      > Yes, that's easy, but first some questions:
      > Can there be ONE number after a space at the end of a line that you want to keep?
      > Can there be FOUR or more numbers after that space at the end of a line that you want to keep?
      > If it is as simple as removing any numbers at the end of a line that are preceded by a space? That is very easy. If it
      > is ONLY two or three numbers, that is slightly different.
      >
      > Do you want a clip that you can repeatedly use for this job, or do you just want to use a find/replace to do it one
      > time?
      > If the latter, in the find box, you choose the regex option, and enter \x20\d+$ and replace it with nothing for any
      > numbers after a space at the end of a line.
      > For the case where it is ONLY two or three numbers, it would be \x20\d\d\d?$ and replace that with nothing.
      >
      > Regards,
      > John
      > RecipeTools Web Site:<http://recipetools.gotdns.com/> http://recipetools.gotdns.com/
      >
      > From: notetab@yahoogroups.com [mailto:notetab@yahoogroups.com] On Behalf Of biwilliams
      > Sent: Sunday, May 27, 2012 18:50
      > To: notetab@yahoogroups.com
      > Subject: [NTB] Remove x number of characters from a line of text
      >
      >
      > Hi all,
      > Discovered Notetab about 6 years ago, and been using it ever since.
      > I bought the full version, but haven't really (up until this point) dived into the real 'heavy lifting' that I suspect
      > it is capable of.
      > But now I have a job to do, and want to know if Notetab Pro can do what I want.
      > I have a series of text files where each line contains a set of data.
      > Each line ends with either a 2 digit number, or a 3 digit number, either of which is preceded by a space.
      > Those numbers are no longer relevent to the data, and I'd like to be able to strip off those characters from the end of
      > each line.
      > Is there a way to write some kind of macro in Notetab Pro that essentially says "look for the last space on a line,
      > followed by a 2 or 3 digit number. now remove the space and the digits which follow it"?
      > Thanks in advance!
    • Show all 22 messages in this topic