Erorire
Re: Merge txt files for selected files
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.
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.
Re: Merge txt files for selected files
Thank you!!swagfag wrote:ControlGet with the List/Selected flags. Then FileOpen each file and write them out to a new file.
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%.
}
Re: Merge txt files for selected files
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
Re: Merge txt files for selected files
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
Who is online
Users browsing this forum: Google [Bot], Leli196 and 310 guests