I thought the point was to remove 'embedded' "blank" lines between the sequential "Member:" lines and NOT to remove ANY number of "blank" lines "preceeding" the "FGroup" lines.
The solution to remove ALL the blanks line and then add them manully does not sound like to satify the latter objective....
Sometimes the question that is asked isn't what is desired. That is why when the input file and desired output was shown, I was able to make some assumptions as what would be the best solution. You can beat your head trying to figure out the solution that fits exactly what the customer wants, but often (as in this case) you only need to meet the desired output.
Maybe the real lesson here is don't be so literal with your customers. You will save yourself a lot of grief if you know what they really want (even if they don't say so).
Cheers, Einstein47 (Love is like PI - natural, irrational, endless, and very important.)
if you're trying to "hack" a task for a particular case of a more generic scenario - that's fine as long as you understand perfectly clear your assumptions and corresponding limitations.
If you feel that developing a more "generic" solution [including your current case] is something achievable and makes it a "challenging" task, why not go for it.....
On the other hand if the task "at hand" is too difficult to generalize, well.... we're back we've started.......
The "lesson" [in my view] is: be as specific as possible - I'll save yourself a lot of energy going over your old and often forgotten implementation time and time again removing "some assumptions as what would be the best solution".
Whatever - maybe I am a lazy programmer. I'll accept that. I don't have all the answers, infact I was pretty clueless on mpv's original question. However, once I saw that input file and the desired output file, the solution came to me.
I'm not saying that a more complex and specific solution wouldn't work, that may be desired. My simplistic approach may turn out to yield unexpected and undesireable results when implemented in production. I just saw the obvious gap and filled it.
I appologize if something I posted offended you. I visit tek-tips to learn more than share. But sometimes I get lucky. Einstein47 (Love is like PI - natural, irrational, endless, and very important.)
I just grew up on comp.lang.awk where every post is looked on from the "theoretical" point of view exploring generic solutions. Based on my experience this approach has been the most fruitful in terms of the knowledge gain potential.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.