Community
    • Login

    Help to arrange text??

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    3 Posts 2 Posters 400 Views 1 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • ParkourfingerP Offline
      Parkourfinger
      last edited by

      Hi guys my problem may seems dumb but i was playing with notepad++ for 2 days and still cant seems to find how to do it :(

      So my question is that i have a set of data arranged in raw text like this :

      Name:Mourat
      Age:65
      Work:Carpenter

      and Because i have lots of data and for efficient time i would like fo it to be output like :

      Mourat|65|Carpenter

      Like all info in the same line separated by a | if you know how to do it please let me know would be glady appreciate :)

      1 Reply Last reply Reply Quote -1
      • guy038G Offline
        guy038
        last edited by

        Hello, @parkourfinger and All,

        • If each record consists of 3 consecutive fields only, use this regex S/R :

        SEARCH : (?-s)^.+:(.+)\R.+:(.+)\R.+:(.+)

        REPLACE \1|\2|\3

        • If each record consists of several consecutive fields, use the generic regex S/R :

        SEARCH (?-is)(?:(Title of the Last Field)|.+)Value Separator(.+)\R?

        REPLACE \2?1\r\n:Field Separator


        In this present example as :

        • The Title of the Last Field is the word Work

        • The Value Separator is the : punctuation sign

        • The Field Separator is the | symbol

        Hence the following regex S/R :

        SEARCH (?-is)(?:(Work)|.+):(.+)\R?

        REPLACE \2?1\r\n:|


        As usual, select the Regular expression search mode and tick, preferably, the Wrap around option !

        Best Regards,

        guy038

        ParkourfingerP 1 Reply Last reply Reply Quote 1
        • ParkourfingerP Offline
          Parkourfinger @guy038
          last edited by

          @guy038 Thank you very much it worked!

          1 Reply Last reply Reply Quote 0

          Hello! It looks like you're interested in this conversation, but you don't have an account yet.

          Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

          With your input, this post could be even better 💗

          Register Login
          • First post
            Last post
          The Community of users of the Notepad++ text editor.
          Powered by NodeBB | Contributors