Hey there,
I was just wondering how you could specify a range when reading a file in ksh?
Suppose I've got some data like so:
Name: Joe
Profession: Blah
Interests: Blah
<Other Text here>
Name: Dave
Profession: Blah
Interests: Blah
<Other Text here>
Now I'd like to read in the file and print out only the part on 'Joe'(the whole chunk - Name, Profession, etc), excluding Dave. Can this be done using grep/sed? I tried grep, but it only returns a single line. I know it can be done using awk, but is there some other way of going about it? Any suggestions?
Thanks for your time. Hope you have a safe and pleasant Easter.
I was just wondering how you could specify a range when reading a file in ksh?
Suppose I've got some data like so:
Name: Joe
Profession: Blah
Interests: Blah
<Other Text here>
Name: Dave
Profession: Blah
Interests: Blah
<Other Text here>
Now I'd like to read in the file and print out only the part on 'Joe'(the whole chunk - Name, Profession, etc), excluding Dave. Can this be done using grep/sed? I tried grep, but it only returns a single line. I know it can be done using awk, but is there some other way of going about it? Any suggestions?
Thanks for your time. Hope you have a safe and pleasant Easter.