I wrote a post last friday but i think that i have not explained well.
I need help with shell script commands to filter information from a text file. This text file is divided into subsections of several lines that begin with a date as a header. There are no blank lines.
The aim is to create a script that receives as input parameter a date and ID number, and it shows only the parragraphs who start whit this date and contains in one of their lines the ID number. �Does anyone know how I can filter out entire paragraphs containing a certain string? I thought of using SED or AWK. THANKS
Thank you very much rdcwayx, but i have a problem, the date can appear behind the text in the parragraph and the output is not right. One solution would be put in the RS "^ 2009-11-10" to capture those dates that appear in the top of the line but I think AWK doesn't let to put regular expressions in the RS field and server does not have GAWK. I got insert with SED a blank line between parragraphs: cat file | sed '/^2009-11-10/{x;p;x;}' , and the new file looks like this: