Marc Tajchman <marc.tajch...@cea.fr> wrote on 08/02/2010 07:34:28 AM:

> Hi,
> 
> I want to read the content of an ASCII file from an X10 program.
> 
> The file contains a sequence of ints, strings, floats, etc separated by 
> spaces (whitespace, tabulation, carriage return). The structure of the 
> file in known (for example : 3 ints followed by a set of lines, each 
> containing 2 ints and a double)
> 
> How to do that ? I tried readDouble(), readInt() from 
> x10.io.(File)Reader, but couldn't make it work.

Hi, Marc,

Just like in Java, readDouble() and readInt() read the raw bits of
Ints and Doubles from the file.  What you want is probably readLine(),
followed by String.split(), followed by the appropriate Int.parse()
and Double.parse() invocations.

Hope this helps,
        Igor
-- 
Igor Peshansky  (note the spelling change!)
IBM T.J. Watson Research Center
X10: Parallel Productivity and Performance (http://x10-lang.org/)
XJ: No More Pain for XML's Gain (http://www.research.ibm.com/xj/)
"I hear and I forget.  I see and I remember.  I do and I understand" -- 
Confucius


------------------------------------------------------------------------------
The Palm PDK Hot Apps Program offers developers who use the
Plug-In Development Kit to bring their C/C++ apps to Palm for a share
of $1 Million in cash or HP Products. Visit us here for more details:
http://p.sf.net/sfu/dev2dev-palm
_______________________________________________
X10-users mailing list
X10-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/x10-users

Reply via email to