Community
    • Login

    Need help withTranspose column to row

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    2 Posts 2 Posters 2.9k Views
    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Á
      Á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
        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
        • First post
          Last post
        The Community of users of the Notepad++ text editor.
        Powered by NodeBB | Contributors