From: Ahmet Kilic Date: 2009-08-27T10:40:50+09:00 Subject: Re: Search keywords inside of directories and files Rodrigo Bermejo wrote: > >> >> To write to a file you need something like this: >> f=File.new("w","myfile.txt") >> f << "line 1" >> f << "line 2" >> f.close > Sorry it should be filename, mode ..this way is the correct. > f=File.new("myfile.txt","w) It is OK. Thank you very much. I don't want to print the whole line, I want to print some sql special words, for example; 1- if the line start with comment(//) do not print the line. 2- if line contain "find" and I want to print the leftside of "::" or class name (like this ClassBase::Class print ClassBase) 3- if line contain "find" and I want to print the sql commands (like insert update ...), table and column names. ( like this; insert into tableA where columnA, columnB, columnC... print he TableA and ColumnA, columnB, columnC ...) please help me. -- Posted via http://www.ruby-forum.com/.