hi everyone,
how could I change the order of the paragraphs as in the list below.
for example: I copy this paragraphs, then when I paste result is paragraphs with a different order
can be done this whit autohotkey?
thank you very much
copy this:
Paragraph 1
Paragraph 2
Paragraph 3
Paragraph 4
Paragraph 5
Paragraph 6
paste:
Paragraph 4
Paragraph 3
Paragraph 5
Paragraph 2
Paragraph 1
Paragraph 6
sort paragraph
-
- Posts: 38
- Joined: 25 Aug 2021, 02:47
Re: sort paragraph
to me these look like lines, not paragraphs, so i guess step 1 is for u to define what a paragraph is and what delimits one
anyway, here is some sample code
anyway, here is some sample code
Code: Select all
#Requires AutoHotkey v2.0.2
input := '
(
Paragraph 1
Paragraph 1
Paragraph 2
Paragraph 2
Paragraph 3
Paragraph 3
Paragraph 4
Paragraph 4
Paragraph 5
Paragraph 5
Paragraph 6
Paragraph 6
)'
P := StrSplit(input, '`n`n', '`r')
output := P[4] '`n`n' P[3] '`n`n' P[5] '`n`n' P[2] '`n`n' P[1] '`n`n' P[6]
MsgBox output
; oldClip := ClipboardAll()
; A_Clipboard := ''
; A_Clipboard := output
; ClipWait()
; Send('^v')
; Sleep(100)
; A_Clipboard := oldClip
-
- Posts: 38
- Joined: 25 Aug 2021, 02:47
Re: sort paragraph
Thank you for your answer
yes, each line contains a paragraph..
unfortunately, I have an older autohotkey version
this is what i want to happen
yes, each line contains a paragraph..
unfortunately, I have an older autohotkey version
this is what i want to happen
Re: sort paragraph
You posted in “Ask for Help (v2)” in the main section, which is now for AHK v2, as the sub-forum title indicates. That’s why you got a response using v2. This thread has been moved to the v1 section.Nick Riviera wrote: ↑ unfortunately, I have an older autohotkey version
Re: sort paragraph
This can be done with ahk. However I am not sure I see the pattern pasted. It seems to be UNsorted.Nick Riviera wrote: ↑11 Apr 2023, 02:33for example: I copy this paragraphs, then when I paste result is paragraphs with a different order
can be done this whit autohotkey?
Who is online
Users browsing this forum: No registered users and 100 guests