Is there a quick (automatic) way to create one long file from all the files in a directory using emacs? IE
>Text_1.txt >{contents of Text_1} >Text_2.txt >{contents of text2} >FinalResult.txt >{contents of Text_1 >contents of Text2}
How about this:
(defun insert-my-files () (interactive) (let ((dir (read-directory-name "Directory to insert: "))) (mapc #'(lambda (file) (let ((file-full (concat dir file))) (insert-file-contents file-full))) (cddr (directory-files dir)))))
Name it Mx insert-my-files , and it inserts the contents of the directory that you supply.
Mx insert-my-files
I do not know, you would call it a quick way, but insert-file can be used to insert a file into an existing buffer.
insert-file
In the specific case you are talking about, the fastest way is probably from the command line: cat * > FinalResult.txt
cat * > FinalResult.txt
Source: https://habr.com/ru/post/1498095/More articles:Why does inheritance from an object matter in Python? - pythonDownload Debian from Android - androidAmazon MWS (PHP) - How the request works - phpSend generated zip file using ExpressJS - node.jsCross fading background image using jQuery - javascriptDoes latex (describe (...)) work under knitr with MiKTeX? - knitrtimer accuracy: c clock () vs WinAPI QPC or timeGetTime () - c ++What is the best way to render circles in iOS? - iosC ++ bandwidth with non primitive types? - c ++How to create a faxed search using SQL Server - sqlAll Articles