Moving Text/Strings

Viewing 6 reply threads
  • Author
    Posts
    • #91198
      Paul Williams
      Participant

      Hi all (again!)

      I need to move some text after the 2nd Tab in a list.
      eg: TEXT1 <TAB> TEXT2 <TAB> TEXT3 <TAB> TEXT4

      And I want to get it to read as per the example:

      eg: TEXT2 <TAB> TEXT1 <TAB> TEXT3 <TAB> TEXT4

      Once again, I would be extremely grateful for any help :)

    • #91199
      Masood Ahmad
      Participant

      Try this:

      GREP Find Change:
      Find what: (.+?\t)(.+?\t)(.+?\t)(.+)
      Change to Format: $2$1$3$4

    • #91204
      Paul Williams
      Participant

      Perfect!
      Many thanks Masood :)

    • #91206
      Masood Ahmad
      Participant

      Great!

      I tried to wrap up the complete string as mentioned in your query. The idea behind this is to let you know how it works. However, it can be shortened if you just want to swap the First Tab with the Second.

      Try this as well:

      GREP Find Change:
      Find what: ^(.+?\t)(.+?\t)
      Change to Format: $2$1

    • #91208
      Paul Williams
      Participant

      I thought that was the case and I did try that – it also worked:)

      Because I am using this in a script does it need to have \\t rather than \t or is that not necessary?

      Many thanks :)

    • #91209
      Masood Ahmad
      Participant

      Though, I do not know much about programming/scripting, but I’m sure it is not necessary to use \\t, \t works fine in a script.

    • #91312
      Paul Williams
      Participant

      Thanks again Masood :)

Viewing 6 reply threads
  • You must be logged in to reply to this topic.
>