TCS IRA UNIX 22 FEB 2022 QUESTION AND SOLUTION

 HELLO DORAEMONS,


IN THIS BLOGPOST ,I HAVE SHARED THE RECENTLY ASKED UNIX/BASH QUESTION AND SOLUTION WHICH IS CERTAINLY USEFUL WHEN YOU WANT TO PRACTICE.HOPE THIS BLOG IS USEFUL TO YOU.

Write the Unix command to display the number of cars who are belonging to car company named Tata Motors and Model Type is EV

The details of the cars are stored in a file(inputfile) in the following format.

Carld*ModelName*CarCompany*ModelType

where symbol "*' is used as the field delimiter for the file. If there is no record in input file or no records satisfying the above criteria, print "No records found"

The file name will be provided as command line argument when the script containing your command will run. You can use shell variables (e.g. $0,$1,$2) whichever is applicable for your requirement to provide the command line argument.

For more clarity, please refer to the sample input and output below.

Note: The string values for CarCompany and ModelType can be in any case, hence search should be case insensitive.

You can use shell variables (e.g. $0,$1,$2) whichever is applicable for your requirement to provide the command line argument.

Lang!

For more clarity, please refer to the sample input and output below.

ALL

Note: The string values for CarCompany and ModelType can be in any case, hence search should be case insensitive.


Sample Input 1:


Carld*ModelName*CarCompany*ModelType 

1*Tata Punch*Tata Motors*Petrol 

2*Tata Nexon*Tata Motorstev 

3*Tigor*Tata Motors*EV 

4*10*Hyundai*Petrol 

5*i20*Hyundai*Petrol

Output:

2


Sample Input 2:


Carld*ModelName*CarCompany*ModelType 

1*Tata Punch*Tata Motors*Petrol 

2*Tata Nexon*Tata Motors*Petrol 

3*Tigor*Tata Motors*Petrol 

4*i10*Hyundai*Petrol 

5*i20*Hyundai*Petrol


Output:

No records found


IF YOUR CONFUSED AND DON'T KNOW HOW TO SOLVE THIS QUESTIONS. REFER TO THE BELOW VIDEO.I HAVE GIVEN DETAILED STRUCTURE TO FOLLOW AND EASIEST WAY TO SOLVE THIS QUESTION.

(DO WATCH IT AFTER 4:05 DURATION)



HOPE THIS IS HELPFUL TO YOU GUYS.IF YOU LIKE MY WORK ,CONSIDER SUBSCRIBING TO MY CHANNEL AND FOLLOW MY BLOGPOST FOR MORE UPDATES.

0 Comentarios

Follow Me On Instagram