LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
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, 03: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, 03: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,541

Rep: Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065
awk.

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

Rep: Reputation: 7944Reputation: 7944Reputation: 7944Reputation: 7944Reputation: 7944Reputation: 7944Reputation: 7944Reputation: 7944Reputation: 7944Reputation: 7944Reputation: 7944
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 09:46 PM
reading and printing out a text file in html mrobertson Programming 1 07-08-2005 11:47 PM
Problem with reading and printing a character hubabuba Programming 3 02-28-2005 02:41 PM
problem in reading Microsoft word as a binary file ljqu_happy Programming 15 02-02-2005 10:10 AM
Kprinter hangs when printing Word docs Bazbo Linux - Newbie 0 08-24-2004 04:53 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 10:35 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
Open Source Consulting | Domain Registration