• Login
Community
  • Login

Need to Change multiple rows to Columns

Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
14 Posts 2 Posters 2.8k 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.
  • A
    akkubhai @Terry R
    last edited by Aug 8, 2022, 4:58 PM

    @Terry-R I will explain more in detail.

    From:

    https://lookimg.com/image/sample-1.QBGTBV

    To:

    https://lookimg.com/image/sample-2.QBMzjv

    I hope It will be more clear in detail.

    Thank you for helping me out.

    T 2 Replies Last reply Aug 8, 2022, 6:10 PM Reply Quote 0
    • T
      Terry R @akkubhai
      last edited by Aug 8, 2022, 6:10 PM

      @akkubhai said in Need to Change multiple rows to Columns:

      I hope It will be more clear in detail.

      It’s still images. Either follow the instructions in the pinned post or no one will help. We need the text to copy so we can try to find the solution.

      Terry

      A 1 Reply Last reply Aug 8, 2022, 7:43 PM Reply Quote 0
      • T
        Terry R @akkubhai
        last edited by Terry R Aug 8, 2022, 7:39 PM Aug 8, 2022, 7:38 PM

        @akkubhai said in Need to Change multiple rows to Columns:

        I hope It will be more clear in detail.

        I took another look at the images and it is possible to produce a regular expression to achieve what you want. However for anyone to create the answer we need text that we can copy to test with. The post I referred to shows how to include examples inside of boxes in the post. This prevents the posting engine from changing the example data.

        See how this text is inside of a box:

        This is achieved by inserting this sentence, selecting all the characters in the sentence and then clicking on the `</>` icon above the box where you typed.
        

        It appears that the empty space in between columns is about 8 or more characters wide. This can be used to change to a carriage return/line feed. So something like:
        Find What:(?-s)^(.+?)\x20{8,}(.+?)\x20{8,}(.+)
        Replace With:${1}\r\n${2}\r\n${3}

        This is untested as you have not provided text to work with. Sorry but that’s all I can/will do unless you insert text as requested to test with.

        Terry

        T 1 Reply Last reply Aug 8, 2022, 8:06 PM Reply Quote 2
        • A
          akkubhai @Terry R
          last edited by Aug 8, 2022, 7:43 PM

          This post is deleted!
          1 Reply Last reply Reply Quote 2
          • T
            Terry R @Terry R
            last edited by Terry R Aug 8, 2022, 8:08 PM Aug 8, 2022, 8:06 PM

            @Terry-R said in Need to Change multiple rows to Columns:

            Find What:(?-s)^(.+?)\x20{8,}(.+?)\x20{8,}(.+)
            Replace With:${1}\r\n${2}\r\n${3}

            It turns out that my suggestion was very close. Change the Replace With field to:${1}\r\n${2}\r\n${3}\r\n
            This adds an additional carriage return and line feed so you get empty lines between each set of 3 lines.

            I also note that the original text sometimes has multiple spaces between words, yet you show the result as only having single spaces, although as your result isn’t inside of another box, multiple spaces may have been removed by the posting engine. So if you need to further adjust the text, this can be achieved by using a second regular expression after the first has completed. Again using the Replace function you have:
            Find What:\x20+
            Replace With\x20

            Good luck.

            Terry

            A 1 Reply Last reply Aug 9, 2022, 6:10 AM Reply Quote 3
            • A
              akkubhai @Terry R
              last edited by Aug 9, 2022, 6:10 AM

              This post is deleted!
              T 1 Reply Last reply Aug 9, 2022, 7:06 AM Reply Quote 0
              • T
                Terry R @akkubhai
                last edited by Aug 9, 2022, 7:06 AM

                @akkubhai said in Need to Change multiple rows to Columns:

                One more small help from you

                Your request doesn’t reflect what your To: box shows. I will go with what the box shows. So again using the Replace function we have:
                Find What:(?-s)^(.+?\x20{8,})(.+?\x20{8,})(.+)
                Replace With:${2}${1}${3}

                Hopefully you can see this is very similar to the previous solution.

                As you haven’t provided an after view for your 6 column request I cannot produce a solution.

                Terry

                A 1 Reply Last reply Aug 9, 2022, 7:32 AM Reply Quote 1
                • A
                  akkubhai @Terry R
                  last edited by Aug 9, 2022, 7:32 AM

                  This post is deleted!
                  T 1 Reply Last reply Aug 9, 2022, 8:23 AM Reply Quote 0
                  • T
                    Terry R @akkubhai
                    last edited by Terry R Aug 9, 2022, 8:24 AM Aug 9, 2022, 8:23 AM

                    @akkubhai said in Need to Change multiple rows to Columns:

                    Sorry, I will provide you now, please check below.

                    The solution shown below should work for you, it does on the examples you provided, although I’m somewhat skeptical that the examples are actual data, not just random stuff you have combined in a haphazard fashion. Bear in mind that if it doesn’t work it’s due to your examples not being truly representative of the real data you want to work on. Again it builds on the previous 2 since they all deal with the same type of “before” data.

                    Find What:(?-s)^([^ ]+)\x20+([^ ]+)\x20+([^ ]+)\x20+(.+?)\x20{8,}(.+?)\x20{8,}(.+)
                    Replace With:${1}\r\n${2}\r\n${3}\r\n${4}\r\n${5}\r\n${6}\r\n

                    At this point I will point you to our FAQ section. In there is a post called “Where to find REGular EXpressions (RegEx) documentation ?”, here. You should read that and consider starting to learn regex (Regular Expression).

                    In the forum we are happy to initially help by providing these regexes, but after a few free ones we expect posters (that’s you) to start trying to create your own. We are still here to guide, but if you do continue to ask for help, expect us to ask what you have tried. If you can at least show some work you have done we will often help you. But if you don’t want to learn and try to solve the questions yourself, you might also find we aren’t so inclined to help either.

                    Terry

                    A 1 Reply Last reply Aug 9, 2022, 2:14 PM Reply Quote 2
                    • A akkubhai deleted this topic on Aug 9, 2022, 11:21 AM
                    • P PeterJones restored this topic on Aug 9, 2022, 1:22 PM
                    • A
                      akkubhai @Terry R
                      last edited by Aug 9, 2022, 2:14 PM

                      @Terry-R Thank you so much for your help.

                      1 Reply Last reply Reply Quote 1
                      14 out of 14
                      • First post
                        14/14
                        Last post
                      The Community of users of the Notepad++ text editor.
                      Powered by NodeBB | Contributors