LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Reading and printing the 5th, 10th, 15th...word of any file (https://www.linuxquestions.org/questions/linux-newbie-8/reading-and-printing-the-5th-10th-15th-word-of-any-file-658852/)

dahr 07-28-2008 03:36 PM

Reading and printing the 5th, 10th, 15th...word of any file
 
I need a script that could read and print the 5th, 10th, 15th... word of any file.

Any guess?

tronayne 07-28-2008 03:50 PM

awk.

Hint: print $5, $10, $15

TB0ne 07-28-2008 03:51 PM

Quote:

Originally Posted by dahr (Post 3229043)
I need a script that could read and print the 5th, 10th, 15th... word of any file.

Any guess?

Guess for what? Can it be done? Yes, easily. I'd also guess this is homework.....check out one of the numerous shell-script tutorials that can be found on Google.

If you have a script that has a problem, post it with the error message(s), and we'll be glad to help.


All times are GMT -5. The time now is 04:06 AM.