When you go sort a multi-lined variable, or in my case a file, it just crams it all into a single line.
Is there a way to get around this?
Sort while Retaining Linefeeds? Topic is solved
Re: Sort while Retaining Linefeeds?
Are you talking about the AHK Sort command? If so, you might want look at the Dx option.
Re: Sort while Retaining Linefeeds? Topic is solved
It might be that you have text which is LF-delimited, you can replace LFs (linefeeds) with CRLFs, see example below.
Note: if you paste such text into Excel, Excel can handle the LFs.
Note: if you paste such text into Excel, Excel can handle the LFs.
Code: Select all
q::
vText := "a`nb`nc"
vText := StrReplace(vText, "`n", "`r`n")
Clipboard := vText
MsgBox, % "done"
return
homepage | tutorials | wish list | fun threads | donate
WARNING: copy your posts/messages before hitting Submit as you may lose them due to CAPTCHA
WARNING: copy your posts/messages before hitting Submit as you may lose them due to CAPTCHA
Re: Sort while Retaining Linefeeds?
Alright, I've changed nothing (and I know a lot of you won't believe me) in my script or the file I'm editing with AHK, but now it's not putting everything in one line anymore. It is cutting off on random lines, but after a few runs, it doesn't do it anymore.
I have no idea what's going on.
I have no idea what's going on.
Re: Sort while Retaining Linefeeds?
I believe you but without you posting some code and example input I can't help you.
Re: Sort while Retaining Linefeeds?
EDIT: Alright I messed up. Sorry
Apparently, it wasn't the sort command. It was that I forgot to add a linefeed to the end of my FileAppend command, and SciTE4AHK sees the single line as multiple lines, while Notepad saw it as a single line.
Apparently, it wasn't the sort command. It was that I forgot to add a linefeed to the end of my FileAppend command, and SciTE4AHK sees the single line as multiple lines, while Notepad saw it as a single line.