in reply to Re: Parsing { } nested data in a file
in thread Parsing { } nested data in a file

It If it would be very simple, please take 5 minutes to write the code to demonstrate the idea. Perl does awk quite nicely after all and the more approaches demonstrated, the better.

  • Comment on Re^2: Parsing { } nested data in a file

Replies are listed 'Best First'.
Re^3: Parsing { } nested data in a file
by Anonymous Monk on May 03, 2018 at 02:01 UTC
    Instead, it is quite reasonable to assume that the OP was not born yesterday. Every significant \n-delimited line of any interest within the file as presented contains an instantly-identifiable, regex-friendly pattern. Long before a man named Larry Wall decided that he could do awk one-better, awk was solving pragmatic problems more-or-less exactly like this one. Translation of this concept into actual Perl source-code is left as an exercise to the reader, and s/he has about thirty years' worth of source-code to get ideas from.
      It looks to me like a very simple awk-like approach would serve you... Translation of this concept into actual Perl source-code is left as an exercise to the reader, and s/he has about thirty years' worth of source-code to get ideas from.

      So your original and most recent replies could be distilled and clarified into two words: "Google it." Wonderful. That's most helpful.


      Give a man a fish:  <%-{-{-{-<

      I suppose that could be true. The OP only asked a question after all. It's entirely possible daniel99 did not want an answer to the question but would be grateful for just a reminder that awk exists; a2p while we're on it. And it seems possible he is 18, going on 19, years of age which, as you rightly point out, means he was not born yesterday, strengthening your case. Lord knows most of the monks here do not like to see or compare or discuss or learn about code so withholding it is an act of humanitarianism, I understand. Let them eat fish!

      For my part, if someone says something is “very simple” it is less assumption and more reasonable that put up or shut up is a fair rejoinder. And to continue to be fair, translation of concepts into “actual Perl source-code” can only ever possibly be left as an exercise for others by someone who knows no Perl. I keep saying bloviate lately. It's wearing. Maybe I might finally get a neologism to stick, boviate.

       
      bloviate /blōvēˌāt/
      v, to speak or write verbosely and windily.
      boviate /bōvēˌāt/
      v, to bloviate strictly by making cow sounds; mooing, pie spattering, hoof clatter on keyboards, and so on.
       
      a real bottom of the barrel post Sundial