File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Linux / UNIX and the fly likes retrieve float values from file Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » Linux / UNIX
Bookmark "retrieve float values from file" Watch "retrieve float values from file" New topic

retrieve float values from file

Rocky Salve

Joined: Apr 05, 2006
Posts: 16
can anyone help me to retrieve floating-point values from files using linux scripting for performing arithmetic operations

for ex; in file f1

12.22 22.33 12.32

using script those above value should be retrieved and added
and results stored in other file
Gerardo Tasistro
Ranch Hand

Joined: Feb 08, 2005
Posts: 362
What do you mean by "linux scripting"??

BASH, SH, Perl??? What do you start with and what do you want to end with? Describe your program.
Stefan Wagner
Ranch Hand

Joined: Jun 02, 2003
Posts: 1923

if sed and bc is installed, use that:

[ April 15, 2006: Message edited by: Stefan Wagner ]
I agree. Here's the link:
subject: retrieve float values from file