Need to Change multiple rows to Columns
-
Hi,
I need help as I need to change multiple rows to Columns. Below I have given an example please help as I have nearly 100 multiple rows similar to the data below example in one text file.Example Data:
Biolife Grup, Boldero, Tallahassee, LBY (f.inPlace(HTMLElement. Linden H!ll’sTimothy Avenue, DenverBahrainAlaskaNeed to change it to the below sequence:
Biolife Grup, Boldero, Tallahassee, LBY
(f.inPlace(HTMLElement.
Linden H!ll’sTimothy Avenue, DenverBahrain4Alaska -
@akkubhai said in Need to Change multiple rows to Columns:
Hi,
I need help as I need to change multiple rows to Columns.As you haven’t provided much in the way of examples and the one line of example seems to be artificial, I can’t promise that my solution will match your needs. If that is the case I suggest you read our FAQ posts which outlines the way in which examples need to be provided and the why. It’s here: template for search/replace questions
and here: how to format examplesAs this uses regular expressions your search mode must be “regular expression”. Use the Replace function and copy the below red text into each of the fields.
Find What:
(?-s)^((?:[^,]+,){3}.+?)(?=\x20\()\x20(.+?\.)\x20(.+)
Replace With:${1}\r\n${2}\r\n${3}
Terry
-
This post is deleted! -
@akkubhai said in Need to Change multiple rows to Columns:
Please look at the image below for an example
I looked at the image but it doesn’t make any sense. I suggest you read the pinned post in the Help Wanted section called "Please Read This Before Posting ". From there also read the "Template for search/Replace Questions " which will guide you on how to include examples.
The image is no good for working on a solution. Make sure to include multiple lines in both a before View and the same lines as you want them afterwards. This is the only way you will get a solution that works.
Terry
-
@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.