Hi All,
I have the following text file and I want to display only the lines where "Vacancy" field (or column) is set to "YES".
$ cat movielist
[Showtimes],[Movie Title],[Vacancy]
1300 2Oct,X-files,Yes
1600 2Oct,Xmen,No
1700 2Oct,Spiderman, Yes
I tried but I was not successful. What change should I do at line no 6?
Thanks & Regards
Sathish Kumar
I have the following text file and I want to display only the lines where "Vacancy" field (or column) is set to "YES".
$ cat movielist
[Showtimes],[Movie Title],[Vacancy]
1300 2Oct,X-files,Yes
1600 2Oct,Xmen,No
1700 2Oct,Spiderman, Yes
Code:
1 show_file()
2 {
3 echo "Show file is called";
4 awk -F',' '
5 {
6 [B]if ($3 ~ (/^YES/))[/B]
7 {
8 {print $2, $1, $3};
9 }
10
11 }' movielist
12 }
13
Thanks & Regards
Sathish Kumar
Comment