how does this work....

1|foo|bar
2|usa|ll
3|usa|vg
4|usa|vg
5|bar|vg
6|usa|vg
7|usa|ll
8|uk|nn
9|foo|manu|bar
10|uk|bb
11|foo|mm
12|kuwait|jkj
13|kuwait|mm
14|dubai|hh

awk '/foo/,/bar/' test_file1----command run at the prompt

output should have been the first 3 lines......

1|foo|bar
9|foo|manu|bar
11|foo|mm
12|kuwait|jkj
13|kuwait|mm
14|dubai|hh

awk '/foo/,/bar/' test_file1

It will print lines containing foo to lines containing bar.If it is not able to find the second pattern it will print till the end of the file.