Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Fastest way to get the number of lines
Date: Tue, 16 Sep 2008 21:55:03 +0000 (UTC)
Organization: AIR Worldwide Corp
Lines: 15
Message-ID: <gap9vn$jqf$1@fred.mathworks.com>
References: <g8v5cv$1us$1@fred.mathworks.com> <Z8Gsk.114613$nD.80388@pd7urf1no> <g9037b$efl$1@fred.mathworks.com> <g90jtn$p9g$1@z-news.pwr.wroc.pl>
Reply-To: <HIDDEN>
NNTP-Posting-Host: webapp-05-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1221602103 20303 172.30.248.35 (16 Sep 2008 21:55:03 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Tue, 16 Sep 2008 21:55:03 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1076536
Xref: news.mathworks.com comp.soft-sys.matlab:490540


Similarly instead of counting the number of lines in the file, can the PERL code be modified to find the first row (of the first column only) that contains a specified value?

For example, if the file looks like
2,45,56,7767,76,565.5,...
23,454,556,74767,476,5465.5,...
56,15,16,1767,176,1565.5,...
678,45,5,67,6,0.5,...
845,11,22,45,32,2.5,...
...

For example, I want to know the line number that the first column contains 678, then the line number should be 4.

Thanks so much in advance.
Pete