[TxMt] Re: Combining files?
Hans-Jörg Bibiko
bibiko at eva.mpg.de
Mon Jul 28 15:00:28 UTC 2008
On 28.07.2008, at 16:34, Alex Ross wrote:
> On Jul 28, 2008, at 4:20 PM, W. Thomas Leroux wrote:
>
>> I have about 45 files I'd like to combine into one, and short of
>> opening each one and copy & pasting it into the new one, I don't
>> see a
>> clear way to do this in Textmate.
>>
>> I'm certain there *is* a way, I'm just not seeing it. Suggestions?
>
> In bash you can do something like this:
>
> for f in $(ls /path/to/files); do cat $f >> /path/to/newfile; done
>
Or, if you are using the project drawer you can select the desired
files and execute a tmcommand à la:
Input:
none
Command:
eval cat $TM_SELECTED_FILES
Output:
Create New Document
or write the output into a file
Input:
none
Command:
eval cat $TM_SELECTED_FILES > ~/Desktop/myoutput.txt
Output:
none
The same could be achieved if one modifies that code to catch
directories as well.
--Hans
More information about the textmate
mailing list