[TxMt] Re: Combining files?
David Frascone
dave at frascone.com
Tue Jul 29 08:18:18 UTC 2008
Call me a lazy typist, but I prefer:
cat * >/some/new/file.txt
On Mon, Jul 28, 2008 at 11:13 AM, W. Thomas Leroux <wtleroux at gmail.com>wrote:
> Some good ideas. I then realized I could solve the problem simply,
> select all the files in a directory, copy, paste into Textmate (pastes
> file names), replaced the linefeeds with spaces, copied that, opened
> the shell and then typed (and pasted) cat file1 file2 file3 file4 etc
> >destination.txt
>
> Worked like a charm.
>
> Then, after all that, I realized that it was bbEdit that allowed me to
> open a slew of files into one. Handy, that.
>
> Thanks all!
>
> Tom
>
> On Mon, Jul 28, 2008 at 11:00 AM, Hans-Jörg Bibiko <bibiko at eva.mpg.de>
> wrote:
> >
> > 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
> >
> > _______________________________________________
> > textmate mailing list
> > textmate at lists.macromates.com
> > http://lists.macromates.com/listinfo/textmate
> >
>
>
>
> --
> All about me!
> http://www.leroux.ca
>
> _______________________________________________
> textmate mailing list
> textmate at lists.macromates.com
> http://lists.macromates.com/listinfo/textmate
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macromates.com/textmate/attachments/20080729/611a6a9e/attachment.html>
More information about the textmate
mailing list