LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 07-28-2008, 04:36 PM   #1
dahr
LQ Newbie
 
Registered: Jul 2008
Posts: 1

Rep: Reputation: 0
Question 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?
 
Old 07-28-2008, 04:50 PM   #2
tronayne
Senior Member
 
Registered: Oct 2003
Location: Northeastern Michigan, where Carhartt is a Designer Label
Distribution: Slackware 32- & 64-bit Stable
Posts: 3,479

Rep: Reputation: 1020Reputation: 1020Reputation: 1020Reputation: 1020Reputation: 1020Reputation: 1020Reputation: 1020Reputation: 1020
awk.

Hint: print $5, $10, $15
 
Old 07-28-2008, 04:51 PM   #3
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 17,960

Rep: Reputation: 3693Reputation: 3693Reputation: 3693Reputation: 3693Reputation: 3693Reputation: 3693Reputation: 3693Reputation: 3693Reputation: 3693Reputation: 3693Reputation: 3693
Quote:
Originally Posted by dahr View Post
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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] find a word in a file, and change a word beneath it ?? vikas027 Programming 10 02-14-2008 10:46 PM
reading and printing out a text file in html mrobertson Programming 1 07-09-2005 12:47 AM
Problem with reading and printing a character hubabuba Programming 3 02-28-2005 03:41 PM
problem in reading Microsoft word as a binary file ljqu_happy Programming 15 02-02-2005 11:10 AM
Kprinter hangs when printing Word docs Bazbo Linux - Newbie 0 08-24-2004 05:53 PM


All times are GMT -5. The time now is 12:53 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration