<div> </div> <div>Hi Mathew,</div> <div> </div> <div>Sure. I have a CSV file and I need to extract two first columns. Consider it as following:</div> <div> </div> <div>****************************************************<BR>"ID","Name","RS","Column","Created On","Last Modified"<BR>"4","STUDENT TABLE","DB 001","UINT:Time<BR>UINT:User ID<BR>VARCHAR1:User Name<BR>VARCHAR4:Data","2006/08/09:12:47:51","2006/08/09:12:47:51"</div> <div><BR>"5","TEACHER TABLE","DB 002","UINT:Time<BR>VARCHAR4:Request<BR>VARCHAR4:Response<BR>UINT:Response Time","2006/08/09:12:47:51","2006/08/09:12:47:51"<BR>***************************************************</div> <div>In command line I do:</div> <div>cut -f 2 file1.tmp | grep "DB" | awk ' {print $0} ' | cut -f 1-2 d, > tables_list.tmp</div> <div> </div> <div>then tables_list file has:</div> <div> </div> <div>"4","STUDENT TABLE"</div> <div>"5","TEACHER TABLE"</div> <div> </div> <div>Then I use sed
command to remove double quotes and ...</div> <div> </div> <div>Now. when I use awk is my script instead of replacing $0 with a line from the text file it replaces it with script name. I need to override this.</div> <div> </div> <div>Any suggestions?</div> <div>Thanks in advance.</div> <div> </div> <div> </div> <div>~<BR><BR><B><I>matti <mathew_2000@yahoo.com></I></B> wrote:</div> <BLOCKQUOTE class=replbq style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #1010ff 2px solid"><BR><BR>--- Ramsin Savra <RAMSINSAVRA@YAHOO.COM>wrote:<BR><BR>> <BR>> Hello Group,<BR>> <BR>> I have a quick question about awk. In command line using awk ' {<BR>> print $0} '<BR>> is not a problem but when I want to use it in a script it causes<BR>> problem. since it points to the name of the script but I need to use<BR>> it for a different purpose which is printing a line from a CSV file.<BR>> <BR>> Would you pelase give me
some advice on this?<BR><BR>Could you restate this, perhaps an example??<BR><BR>thanks<BR>matti<BR><BR><BR>__________________________________________________<BR>Do You Yahoo!?<BR>Tired of spam? Yahoo! Mail has the best spam protection around <BR>http://mail.yahoo.com <BR></BLOCKQUOTE><BR><p> 
                <hr size=1>Talk is cheap. Use Yahoo! Messenger to make PC-to-Phone calls. <a href="http://us.rd.yahoo.com/mail_us/taglines/postman7/*http://us.rd.yahoo.com/evt=39666/*http://messenger.yahoo.com"> Great rates starting at 1¢/min.