Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re^2: Help for generating multiple file from singl e file and parsing it.

by sarf13 (Beadle)
on Oct 16, 2011 at 04:47 UTC ( [id://931732]=note: print w/replies, xml ) Need Help??


in reply to Re: Help for generating multiple file from singl e file and parsing it.
in thread Help for generating multiple file from singl e file and parsing it.

thank you very for you reply.
while ia m running this code it is giving me some error which is
Use of uninitialized value $str in string at test2.pl line 13, <DATA> line 8968. Use of uninitialized value $date in concatenation (.) or string at test2.pl line 13, <DATA> line 8968. Use of uninitialized value $str in string at test2.pl line 13, <DATA> line 8968. Use of uninitialized value $date in concatenation (.) or string at test2.pl line
i am not able to understand.

Replies are listed 'Best First'.
Re^3: Help for generating multiple file from singl e file and parsing it.
by Marshall (Canon) on Oct 17, 2011 at 15:58 UTC
    what you describe would be a symptom of say a blank line at the end of the DATA section although I'm not sure how you get to line 8968! The code should skip blank lines and this shouldn't matter.

    I just ran the code here again. Download and run it verbatim.

      Hi Marshall thank you very much for help me out. now it working perfectly.
      i have one more issue can you please guide me for writing a reguler expression for substitution.
      i have this pattern :- 3023NMANS.20111011.2 as a value of hash where starting no (3023) and last no (.20111011.2) will be change and NMANS wil be constant.i need to write reguler expression for substituting this pattern with nothing.
      i really appreciate for your help.
        Still not sure what you want. To separate the numbers back out, perhaps:
        #!/usr/bin/perl -w use strict; my $str ='3023NMANS.20111011.2'; my ($front,$end) = $str =~ /^(\d+)NMANS([.\d]+)/; print "$front $end\n"; #3023 .20111011.2
        if you are using 3023NMANS.20111011.2 as a hash key, then you want to delete it to remove it and its associated value from the hash.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://931732]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (4)
As of 2024-03-29 09:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found