Actually, this command only gives me the lines that contain aile 2. I am trying rather to capture the values of "aile 2" i.e all the lines that come after "aile 2" including the lines with aile "2".
Yeah, the idea is right. The file however can have more than 4 lines. As you said, if a line contains aile, then print all the lines that follow will work.
Note. Sometimes I have a huge file that has info for 100 ailes, but I just want to retrieve the info for a specific aile.
The original example showed:
philo 1 gr 056 am 145 co 0 aile2
niveau 2, txt 001 La vida ID 2, da VI 2100
But, you said there could be additional lines. If more lines, how would program know that it has reached the end of the section? By two consecutive <CR><LF> entries?
Up to how many lines could be included?
Is there any pattern to these?
There should be a way to tell the program to read the lines that come after the "line with aile 2" regardless of how many lines there are. But, for the sake of this conversation, let's say there 8 more lines.
philo 1 gr 056 am 145 co 0 aile2
niveau 2, txt 001 La vida ID 2, da VI 2100
niveau 3, txt 001 La vida ID 3, da VI 3200
niveau 4, txt 001 La vida ID 4, da VI 4300
niveau 5, txt 001 La vida ID 5, da VI 5400
niveau 6, txt 001 La vida ID 6, da VI 6500
niveau 7, txt 001 La vida ID 7, da VI 7600
niveau 8, txt 001 La vida ID 8, da VI 8700
niveau 9, txt 001 La vida ID 9, da VI 9800
ailed is the input file based on your first message
awk 'BEGIN {RS=""} /aile2/' ailed
gives:
A 11 PROK:File 001 Mes amis, Mes amies
La vie
philo 1 gr 056 am 145 co 0 aile2
niveau 2, txt 001 La vida ID 2, da VI 2100
A 13 PROK:File 001 Mes freres, Mes soeurs
La servitude
philo 1 gr 006 am 145 co 0 aile2
niveau 1, txt 011 La vida ID 2, da VI 2100