tru64-unix-managers (formerly alpha-osf-managers) (1994-2012)
 help / color / mirror / Atom feed
* Extracting word from Line
@ 1998-05-20  9:17 R. M. Sundaram
  0 siblings, 0 replies; only message in thread
From: R. M. Sundaram @ 1998-05-20  9:17 UTC (permalink / raw)
  To: tru64-unix-managers

Thanks to  Jean, Bernt, Akihito, Jim Belonis, Alan Garde.

I have one more query: is it possible to read ONE WORD at a time from
the file.
.
=============================
SUMMARY : Reading one line from file.
======================
        more -n 1 filename
=======================
$ cat /etc/motd  | while read line
        > do
        >       echo $line
        > done
=========================
Take Perl and have a solution for many platforms...
Something like:
#!/usr/local/bin/perl       - or whereever you install it...
$inputfile="<your-input-filename>";
open FILE, $inputfile or die "\nCan't open $inputfile\n";
while (<FILE>) {
   print "$_ \n";  # print each line...
}  # end of while-loop
close FILE;
==========================

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~1998-05-20  9:17 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1998-05-20  9:17 Extracting word from Line R. M. Sundaram

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox