In a file , how to retrieve the lines which are the
multiples of 50 ? like 50,100,150th lines etc.

Answer Posted / kavita

awk 'NR % 50 ==0 {print}' filename

Is This Answer Correct ?    6 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How do I read a .sh file?

515


What is web script?

564


How to get script name inside a script?

526


How do we delete all blank lines in a file?

558


What is k shell?

515






What is gui scripting?

577


What are the advantages of shell scripting?

564


what is info area how many types?

2262


How to pass an argument to a script?

576


What is a shell made of?

544


What is the way to do multilevel if-else's in shell scripting?

634


What are the types of script?

599


Determine the output of the following command: [ -z “” ] && echo 0 || echo 1

538


Devise a script that takes file name as arguement(which must present in the current directory)and locates from your home directory tree all thpath names of its links.Then mail the list to self.

1688


Which scripting language is best for automation?

515