Erorire

Get help with using AutoHotkey and its commands and hotkeys
alesyt0h
Posts: 194
Joined: 28 Jan 2015, 20:37

Erorire

21 May 2018, 22:04

Sorry for post
Last edited by alesyt0h on 23 May 2018, 07:23, edited 1 time in total.
Guest

Re: Merge txt files for selected files

22 May 2018, 02:18

Yes, check the Clipboard page in the docs as you can see the after ^c the clipboard will hold a list of selected files (you can also search the forum for more sophisticated solutions to get "selected files" from explorer)

Parse the list using a loop, do a FileRead + FileAppend to merged file (don't forget to include a separator such as a "new line" between files).

Try something, post code if you get stuck.
swagfag
Posts: 3972
Joined: 11 Jan 2017, 17:59

Re: Merge txt files for selected files

22 May 2018, 03:26

ControlGet with the List/Selected flags. Then FileOpen each file and write them out to a new file.
alesyt0h
Posts: 194
Joined: 28 Jan 2015, 20:37

Re: Merge txt files for selected files

22 May 2018, 04:36

swagfag wrote:ControlGet with the List/Selected flags. Then FileOpen each file and write them out to a new file.
Thank you!!

But ControlGet doesn't work for me :(

Code: Select all

ControlGet, List, List, Selected,, A
Loop, Parse, List, `n  ; Rows are delimited by linefeeds (`n).
{
    RowNumber := A_Index
    Loop, Parse, A_LoopField, %A_Tab%  ; Fields (columns) in each row are delimited by tabs (A_Tab).
        MsgBox Row #%RowNumber% Col #%A_Index% is %A_LoopField%.
}
Trying that code but it does nothing..
gregster
Posts: 4912
Joined: 30 Sep 2013, 06:48

Re: Merge txt files for selected files

22 May 2018, 04:58

To get the selected files try:

Code: Select all

F10::
clipboard := ""
Send ^c
Clipwait, 2
Loop, Parse, clipboard, `n  ; Rows are delimited by linefeeds (`n).
    MsgBox File #%A_index% is %A_LoopField%.
return
garry
Posts: 2400
Joined: 22 Dec 2013, 12:50

Re: Merge txt files for selected files

22 May 2018, 07:11

example , copy the content of selected text-files in one text-file

Code: Select all

f1=%a_desktop%\alltext.txt  ; copy the content of selected text-files here
return

F10::
clipboard := ""
Send ^c
Clipwait, 2
Loop, Parse, clipboard, `n  ; Rows are delimited by linefeeds (`n).
  runwait, %comspec% /c type %A_LoopField% >>%F1%,,hide
run,%f1%
return

Return to “Ask For Help”

Who is online

Users browsing this forum: Bing [Bot], mikeyww and 24 guests