The following code is what I used to check if item number could be
detected for the file I sent in the earlier email.  The code seems to
have failed and need a advise on it..


#!C:\perl\bin\perl5.6.1
$file1 = ' C:\perl\bin\dummy.txt' ;


open (INFO, "< $file1 ") or die "Can't open $file: $1";

while (<INFO>)
{

 if ($test = ~ "/2\.2\./d+\./d+\./d+"){

 print " $test \n " ; }}

close (INFO);

It would be a great help if some feedback could be provided...

Sunny.. 

-----Original Message-----
From: Singh, Harjit 
Sent: Monday, August 09, 2004 12:23 PM
To: 'Gunnar Hjalmarsson'
Subject: RE: Trying To write a script

Gunnar,
The file is of the following format:

------------------------------------------------------------------------
---
2.2.4.3.4 XXXXXXX
 This is test of test
 for use by Sunny: 1 
 as stated in 2.2.5.6.1
2.2.5.6.9 YYYYYYYYYY
Note 2: This function consolidates a number of former sections from
3.2.4.
 for use by Sunny: 2
 as discussed in 2.1.2.1
------------------------------------------------------------------------
--

The file shows two items start with 2.2.* and additional detail
underneath it such as Sunny: 1 for 2.2.4.3.4 or Sunny: 2 for 2.2.5.6.9.
I want to be able to break the file capturing its item number along with
number for Sunny: for each of the listed item number.  The item number
always starts in the beginning of line.  See if this helps you in
deciding a code.  

Regards,
Sunny




-----Original Message-----
From: Gunnar Hjalmarsson [mailto:[EMAIL PROTECTED] 
Sent: Monday, August 09, 2004 10:12 AM
To: [EMAIL PROTECTED]
Subject: Re: Trying To write a script

Harjit Singh wrote:
> I am trying to write a script that would be able to read a file.

Are you? I don't see any code.

<verbal file description snipped>

> What is the best approach to be able to make this possible?

I have no idea. But the best approach when seeking help here is to
post a small but complete program, including sample data, that people
can easily copy and run, and that illustrates the problem you are
encountering.

-- 
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>



--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to