Need to Change multiple rows to Columns
-
@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.
-
@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
-
@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
-
This post is deleted! -
@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
-
This post is deleted! -
@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
-
This post is deleted! -
@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
-
-
-
@Terry-R Thank you so much for your help.