From: Tom Bombadil Date: 2007-06-15T16:53:53+09:00 Subject: Create text files... ------=_Part_58534_25836308.1181894032105 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline Hi, I do have a text file as shown below. I'd now like to use Ruby to create separate text files for the content between "======". To do so I have: # Open, read from a text file, and pass to block f1 File.open('test.txt', 'r') do |f1| while line = f1.gets puts line end end # Create a new file and write to it File.open('cve.txt', 'w+') do |f2| if f2 =~ /Name/ puts line end end Though cve.txt is empty and I just have one cve.txt. Pls advise. I appreciate. Test.txt ====================================================== Name: CVE-1999-0005 Status: Entry Reference: CERT:CA-98.09.imapd Reference: SUN:00177 Reference: URL: http://sunsolve.sun.com/pub-cgi/retrieve.pl?doctype=coll&doc=secbull/177 Reference: BID:130 Reference: URL:http://www.securityfocus.com/bid/130 Reference: XF:imap-authenticate-bo Arbitrary command execution via IMAP buffer overflow in authenticate command. ====================================================== Name: CVE-1999-0006 Status: Entry Reference: CERT:CA-98.08.qpopper_vul Reference: SGI:19980801-01-I Reference: URL: ftp://patches.sgi.com/support/free/security/advisories/19980801-01-I Reference: AUSCERT:AA-98.01 Reference: XF:qpopper-pass-overflow Reference: BID:133 Reference: URL:http://www.securityfocus.com/bid/133 Buffer overflow in POP servers based on BSD/Qualcomm's qpopper allows remote attackers to gain root access using a long PASS command. ====================================================== ------=_Part_58534_25836308.1181894032105--