![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Rules & FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| find a word in a file, and change a word beneath it ?? | vikas027 | Shell Programming and Scripting | 2 | 02-13-2008 12:23 PM |
| Add a word at the end of each line in a file | bhalotias | Shell Programming and Scripting | 6 | 01-29-2008 07:07 AM |
| how to move word by word on command line | pbsrinivas | UNIX for Dummies Questions & Answers | 1 | 11-23-2007 02:17 AM |
| Need to replace the first word of a line if it occurs again in the next line(shell) | geeko | Shell Programming and Scripting | 1 | 09-25-2007 07:15 AM |
| how to substitute more than one word in a text file? | forevercalz | Shell Programming and Scripting | 2 | 01-12-2006 02:32 AM |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
Greetings.
I am struggling with a shell script to make my life simpler, with a number of practical ways in which it could be used. I want to take a standard text file, and pull the 'n'th word from each line such as the first word from a text file. I'm struggling to see how each line can be treated differently, and captured as a variable. If I try using the for n in `cat filename` approach, it simply takes each word from the filename. And since the file may have multiple lines, I want to use a text file as the basis for a shell script, using variables taken from the file on a line by line basis. Is there a simple way? Searching google and other search engines pulls up too many read herrings or inappropriate pages. Can anyone please help? |
| Forum Sponsor | ||
|
|