RE: ** OT : awk works only for first line

From: Bobak, Mark <Mark.Bobak_at_proquest.com>
Date: Tue, 27 Jan 2009 20:15:34 -0500
Message-ID: <6AFC12B9BFCDEA45B7274C534738067F09FED539_at_AAPQMAILBX02V.proque.st>



Can you show a small sample of your data, one line that works correctly, and one or more that don't work correctly?

-Mark



From: oracle-l-bounce_at_freelists.org [oracle-l-bounce_at_freelists.org] On Behalf Of A Joshi [ajoshi977_at_yahoo.com] Sent: Tuesday, January 27, 2009 7:25 PM
To: oracle-l_at_freelists.org
Subject: ** OT : awk works only for first line

Hi,
I am trying awk to get the first word from each line in a file : I am doing : BEGIN {
FS=":"
}
{print $1}

For the first line : it prints the first work. For other lines it prints other words also. I tried to put in FS as space but that did not help. Can someone help? I did try google but could only find example like above. Thanks for help.

--

http://www.freelists.org/webpage/oracle-l Received on Tue Jan 27 2009 - 19:15:34 CST

Original text of this message