Long line, into multiple in numerical order
-
Hello, I am trying to sort a long line containing numbers and text into lines by numerical order contained in that same line.
Here is what I am starting with:
Line 1 0 “Alex” 1 “Steve” 2 “Kevin” 3 “Peter”
Here is how I will line to be sorted:
Line 1: 0 “Alex”
Line 2: 1 “Steve”
Line 3: 2 “Kevin”
Line 4: 3 “Peter” -
@Luis-Lucena you can do this in your example using the replace dialog (extended replace).
Finddouble quote and space. Replace All with double quote and \r\n.
I suspect you need something more complicated.
What if the original line is not sorted?
Is your text always enclosed in quotes?
Does your text ever have leading spaces?Give us an example that is ugly, something closer to a worst case.
-
@David-Brigden52 I have tried replace dialog.
For find what I entered a “space”
For replace with I entered “\r\n”However this gets me the following
Line 1: 0
Line 2: “Alex”
Line 3: 1
Line 4: “Steve”
Line 5: 2
Line 6: “Kevin”
Line 7: 3
Line 8: “Peter”I am looking to keep the number along with with value.
Line 1: 0 “Alex”
Line 2: 1 “Steve”
Line 3: 2 “Kevin”
Line 4: 3 “Peter” -
@Luis-Lucena said in Long line, into multiple in numerical order:
For
find what
I entered a “space”Really? That’s what you tried? Did you think about what that might do before you did it? If you were attempting to follow the suggestion of @David-Brigden52 , I think you fell short; way short…
-