copying files from Finder into one text file

29 views
Skip to first unread message

samar

unread,
Jan 22, 2022, 6:27:54 AM1/22/22
to bbe...@googlegroups.com
When I drag a set of text files from the Finder into an empty text file in BBEdit, the contents of these text files are copied into the new file:

<start>
contentsofmyoldfile1
contentsofmyoldfile2
contentsofmyoldfile3
<end>

This is fine, but how can I have a separator (===), the name of each copied file, and an empty paragraph added before its content? What I need is this:

<start>
===
myoldfile1.txt

contentsofmyoldfile1
===
myoldfile2.txt

contentsofmyoldfile2
===
myoldfile3.txt

contentsofmyoldfile3
[etc.]
<end>

I assume achieving this would require some scripting knowledge, but alas, I'm not there yet.

Thanks
Sam

Patrick Woolsey

unread,
Jan 22, 2022, 12:23:16 PM1/22/22
to bbe...@googlegroups.com
Please instead give the Edit -> Insert -> File Contents... command a try, and once you've brought up the file selection sheet, click the "Options" button at the lower left-hand corner as both provided options are relevant to your desired outcome. :-)


Regards,

Patrick Woolsey
==
Bare Bones Software, Inc. <https://www.barebones.com/>
Reply all
Reply to author
Forward
0 new messages