grab the line below a blank line and the line above the next blank line awk or perl?
Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
grab the line below a blank line and the line above the next blank line awk or perl?
Hello,
I am trying to grab the full line below a blank line and the full line above the next blank line, group them together and throw a blank line inbetween them and the next entry like that in the output.
There might also be an easier way, I am trying to get the folder size and the last access time of that folder to make an audit.
That may very well be, but the issue is one of forcing a method of implementation based upon the OPs current perception of how to obtain an answer to a given problem.
A better method would be to describe the goal more precisely (eg. "how do I get total folder size and last access time of a file in a folder?") rather than focusing on the implementation ("how to I solve some problem using some tool I'm not sure is the right tool").
If I am correct in what the user is asking, this is not the best or easiest approach. But I'll wait the OP to clarify.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.