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 whatI 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…
-
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login