in reply to Re^3: Skip lines until you find a delimiter >>
in thread Skip lines until you find a delimiter >>

thank you for the reply.. it was bit urgent.. if i want to sum positive and negative numbers in the same line.. how would i do that..? Currently the code is summing only the positive numbers. it would be really helpful if you can suggest on that.
  • Comment on Re^4: Skip lines until you find a delimiter >>

Replies are listed 'Best First'.
Re^5: Skip lines until you find a delimiter >>
by marto (Cardinal) on Mar 15, 2018 at 14:17 UTC

    I take it you didn't read this part:

    "As an update note: If for some reason this doesn't do exactly what you want, I expect you to spend some time studying the code and for you to make a serious attempt at modifications. I think you are doomed if you just copy code without understanding how it works."

    This isn't a code writing service, the idea is that you learn from the help you've been given. You've been drip feeding different requirements since your initial post. Read and understand How do I post a question effectively? & tutorials->PerlMonks for the Absolute Beginner.

Re^5: Skip lines until you find a delimiter >>
by karlgoethebier (Abbot) on Mar 15, 2018 at 16:45 UTC
    "...it was bit urgent..."

    Yes, sure. I know. It's always the same - hard job etc. Such is life.

    BTW: May i kindly ask if you are aware that there are no SLAs on PM?

    Best regards, Karl

    «The Crux of the Biscuit is the Apostrophe»

    perl -MCrypt::CBC -E 'say Crypt::CBC->new(-key=>'kgb',-cipher=>"Blowfish")->decrypt_hex($ENV{KARL});'Help

Re^5: Skip lines until you find a delimiter >>
by Marshall (Canon) on Mar 15, 2018 at 18:30 UTC
    I suggest that you study this line:
    my (@nums) = /,\s*(\d+)/g;
    It could very well be that it takes you all day to come close to understanding what that does, but such is the nature of learning something that is both new and complicated.

    The major failures in your posting(s): Incomplete/inadequate specification of the problem. And apparently a complete lack of effort on your part to learn from the Monk replies. This last part is the issue that is causing the most problems.

    Your problem can be solved easily with a combination of a text editor and Excel. If you are not willing to put in the effort to learn Perl, then just ask a friend in the accounting department to whip out an answer with off-the-shelf software.

    Update:
    Ok, I don't want to torture you with something that is obvious to the average Monk. A simple way is:

    my (@nums) = /,\s*([-\d]+)/g;
    In the future, please understand that PerlMonks is about learning Perl.