I've pasted a log generated by rsync running through Cygwin on a Windows 2008 server.  I am rsync'ing data over to a new file server (Synology), and after trimming out anything that's not an error, I have a few different errors to deal with, and they're all interlaced.What I want is to quickly and easily, preferably with vim, separate out the different error types, so that all of the lines that start with rsync: send_files (blah blah) are consolidated, and all of the lines that start with file has vanished:  are consolidated, etc.Basically I'm trying to find a way to match a regex, yank/delete all pertinent lines, then paste them either in the same file but all in the same place, or in a new file/buffer.EDIT: a thought just occurred to me.  If I ran sort on this data, it would probably do what I wanted.  I could do that with external tools, but is it possible to do this inside vim, either by calling sort within vim or better still, using tools within vim's native environment.  Really I'm using this as an exercise for me in learning how to use vim better, not other tools.A small sample of the log file, with some information redacted:rsync: send_files failed to open /cygdrive/E/Users/SharedFiles/3DS SALES/3DS MARKETING/PORTFOLIOS/2012 - Portfolios/SignageXXXXXXXX Full Res photos/xxxxx xx sky/.DS_Store: Permission denied (13)file has vanished: /cygdrive/E/Users/SharedFiles/3DS SALES/CURRENT SALES/xxxxxxxxx xxx xxxxx xxxxx xxxx - xxxx/02_PROPOSAL-QUOTATION/15-002 - xxxx xxxx xxxx - Replacement  Private Fuction  Event Board.xlsxrsync: opendir /cygdrive/E/Users/SharedFiles/3DS SALES/CURRENT SALES/Archived Projects/ARCHIVES -xxxxx light/Hootsuite xxxxxx Info failed: Permission denied (13)rsync: opendir /cygdrive/E/Users/SharedFiles/3DS STAFF/Cortney/xxxxx/MANUAL/Support Files/xxx/Photos-Jan-2013 failed: Permission denied (13)file has vanished: /cygdrive/E/Users/SharedFiles/3DS STAFF/Reg/2012 - DEAD PROJECTS/2213-xxxxxx&am;C 60x114-5-HR_pdf/xxxxxx 60 x114.5 _HR.pdffile has vanished: /cygdrive/E/Users/SharedFiles/3DS STAFF/Reg/2012 - DEAD PROJECTS/2213-xxxxxx&am;C 60x114-5-HR_pdf/xxxxxx 47 x94_HR.pdfTime value of 3DS STAFF/X-employees/xxxxxxx/Jobs- do not remove/1OLD FILES/J-M/Jade/xxxxx logo_cmyk.ai-print on paper.eps truncated on receiver.Time value of 3DS STAFF/X-employees/xxxxxx/Jobs- do not remove/1OLD FILES/J-M/Jade/xxxx logo_rgb.ai-website.eps truncated on receiver.file has vanished: /cygdrive/E/Users/SharedFiles/3DS STAFF/X-employees/xxxxx/Found on iMac/xxxxxx FOLDER/Databases  Presentations  Portfolios/Databases/Database  C .xlsxfile has vanished: /cygdrive/E/Users/SharedFiles/CURRENT FILES/12050 - xxxxx Canada - xxxxx National Park/ARTWORK DRAWINGS/xxxxx Graphic Layouts/Batch 4 pdfs for Trish/kathy's Batch 4 pdfs for xxxxx/Links/1 =1' person .epsrsync: opendir /cygdrive/E/Users/SharedFiles/CURRENT FILES/12050 - xxxxx Canada - xxxxx National Park/MANUAL/03_ xxxxx Final Manual_June-2014/ MANUAL FOR CLIENT failed: Permission denied (13)rsync: opendir /cygdrive/E/Users/SharedFiles/CURRENT FILES/12050 - xxxxx Canada - xxxxx National Park/MANUAL/03_ xxxxx Final Manual_June-2014/SECTION 2.0-Exhibits failed: Permission denied (13)rsync: opendir /cygdrive/E/Users/SharedFiles/CURRENT FILES/12050 - xxxxx Canada - xxxxx National Park/MANUAL/03_ xxxxx Final Manual_June-2014/SECTION 7.0_Appendices/Appendix E - Artifact Conservation and Maintenance Manual failed: Permission denied (13)
Vim: consolidate regex-matching lines
vim
Use redir to redirect to a new file::redir > rsync.log:g/^rsync/:redir > file_vanished.log:g/^file/:redir END:qcat rsync.logrsync: send_files failed to open /cygdrive/E/Users/SharedFiles/3DS SALES/3DS MARKETING/PORTFOLIOS/2012 - Portfolios/SignageXXXXXXXX Full Res photos/xxxxx xx sky/.DS_Store: Permission denied (13)rsync: opendir /cygdrive/E/Users/SharedFiles/3DS SALES/CURRENT SALES/Archived Projects/ARCHIVES -xxxxx light/Hootsuite xxxxxx Info failed: Permission denied (13)rsync: opendir /cygdrive/E/Users/SharedFiles/3DS STAFF/Cortney/xxxxx/MANUAL/Support Files/xxx/Photos-Jan-2013 failed: Permission denied (13)rsync: opendir /cygdrive/E/Users/SharedFiles/CURRENT FILES/12050 - xxxxx Canada - xxxxx National Park/MANUAL/03_ xxxxx Final Manual_June-2014/ MANUAL FOR CLIENT failed: Permission denied (13)rsync: opendir /cygdrive/E/Users/SharedFiles/CURRENT FILES/12050 - xxxxx Canada - xxxxx National Park/MANUAL/03_ xxxxx Final Manual_June-2014/SECTION 2.0-Exhibits failed: Permission denied (13)rsync: opendir /cygdrive/E/Users/SharedFiles/CURRENT FILES/12050 - xxxxx Canada - xxxxx National Park/MANUAL/03_ xxxxx Final Manual_June-2014/SECTION 7.0_Appendices/Appendix E - Artifact Conservation and Maintenance Manual failed: Permission denied (13)