1
00:00:01,530 --> 00:00:10,070
If you don't do a search pattern or could go line by line and for each line it performs operations described

2
00:00:10,160 --> 00:00:18,680
in main org section if your search pattern org will perform operations described in the main section

3
00:00:18,740 --> 00:00:23,620
only four lines where pattern was found.

4
00:00:23,760 --> 00:00:27,550
Firstly let's check our team though.

5
00:00:27,650 --> 00:00:32,490
Now let's say did we want to display only Peter name and his unit.

6
00:00:32,750 --> 00:00:43,700
So in our program we will start with search pattern which is a required expression which is typed between

7
00:00:43,700 --> 00:00:44,570
two slushes

8
00:00:47,250 --> 00:00:48,340
so we can type.

9
00:00:48,340 --> 00:00:59,610
Peter and if all Gavilan found line containing what Peter Weaver display name and unit so do I assign

10
00:00:59,610 --> 00:01:01,200
one and dollar signs we

11
00:01:11,020 --> 00:01:19,240
if you push enter we see Peter the Great now let's print.

12
00:01:19,300 --> 00:01:25,700
All people working for I-T department.

13
00:01:26,800 --> 00:01:32,130
But here we see offsider because unit has I-T in its name.

14
00:01:32,200 --> 00:01:43,310
So we need to change search pattern and it will be done by adding up before I-T.

15
00:01:43,310 --> 00:01:52,960
This will work only if you stop separating fields in our table and yes we can see only people working

16
00:01:52,960 --> 00:02:01,570
for either the unit or by default is using basic regular expressions which means that some special characters

17
00:02:01,870 --> 00:02:10,810
needs to be used with backslash in order to not lost its special meaning how to print all records without

18
00:02:10,810 --> 00:02:11,860
the header.

19
00:02:11,980 --> 00:02:21,980
It is by using exclamation mark before search and pattern which describe had so in our case the verb

20
00:02:22,050 --> 00:02:31,110
name can describe header so we will put exclamation mark before searching.

21
00:02:31,140 --> 00:02:31,640
But then

22
00:02:43,880 --> 00:02:46,150
and great works perfectly.

23
00:02:46,160 --> 00:02:50,580
We don't see the heede but still can happen.

24
00:02:50,620 --> 00:02:53,880
Did divert name will be present somewhere else.

25
00:02:53,890 --> 00:03:04,390
So far being sure we can tell don't print the line which starts a it name and the result is the same.

26
00:03:04,410 --> 00:03:13,650
Now let's print only the guys with our display first line do Hegner we can do that as previously using

27
00:03:13,650 --> 00:03:16,060
search pattern Dopp I-T.

28
00:03:16,290 --> 00:03:24,030
Or we can use output of previous awk command as an input to another awk program where we will check

29
00:03:24,030 --> 00:03:32,670
for I-T and will display on line the design zero

30
00:03:36,100 --> 00:03:42,370
and we see Peter and John only grade if you want to display lines.

31
00:03:42,370 --> 00:03:44,700
Her name is Peter.

32
00:03:44,790 --> 00:03:48,050
We can use another option.

33
00:03:48,340 --> 00:03:55,660
So just all die inside single quotation marks of awk.

34
00:03:55,710 --> 00:03:59,560
C'mon dot assign one

35
00:04:04,570 --> 00:04:07,390
double equals sign.

36
00:04:07,420 --> 00:04:15,910
Peter and awk will go line by line and read the first field is equal to Peter.

37
00:04:15,940 --> 00:04:18,340
This line will be printed

38
00:04:21,730 --> 00:04:23,090
similarly.

39
00:04:23,250 --> 00:04:30,520
We can ask to display all the lines where first field is not equal to string name

40
00:04:34,330 --> 00:04:35,350
great.

41
00:04:35,610 --> 00:04:38,390
We see output without the header.
