Community
    • Login

    Need help withTranspose column to row

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    2 Posts 2 Posters 3.1k 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.
    • Ángela RojasÁ Offline
      Ángela Rojas
      last edited by

      Hello,
      I have this:

      Wavelength LFH00300002.asd
      350 0.34586981
      351 0.34210269
      352 0.35421594
      353 0.34231914
      Wavelength LFH00300003.asd
      350 0.34586981
      351 0.34210269
      352 0.35421594

      and i need this:

      LFH00300002.asd 0.34586981 0.34210269 0.35421594 0.34231914
      LFH00300003.asd 0.34586981 0.34210269 0.35421594

      Can someone help me with this? Thank you.

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

        Hello, @ángela-rojas,

        Not very difficult with a regular expression, indeed !

        Assuming that :

        • The word Wavelength, with that exact case, begins a line and is followed by, at least, one space character

        • The different numbers, beginning the following lines, are followed by a single space character

        Just follow the few steps, below :

        • Move back to the very beginning of your file ( Ctrl + Origin )

        • Open the Replace dialog ( Ctrl + H )

        • Type (?-i)^Wavelength +|\R\d+ , in the Find what: box

        • Leave the Replace with: box EMPTY

        • Click on the Replace All button

        Et voilà !

        Notes :

        • The regex search looks, either, for :

          • The string Wavelength, with that exact case, followed by, at least, one space character ( + )

          • Some End of Line characters (\R ), immediately followed by, at least, one digit ( \d+ )

        • Whatever the case found, the overall match is deleted, due to the empty replacement regex

        Best Regards

        guy038

        P.S. :

        • In case the numbers, beginning the line, are followed by several space characters, prefer the regex S/R, below :

        SEARCH (?-i)^Wavelength +|\R(\d+) +

        REPLACE ?1\x20

        • If the search must not be sensitive to case, just change the (?-i) part by the (?i) syntax
        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