digitalmars.D - Skiping whitespace
- matovitch (12/12) May 26 2013 Hello,
- matovitch (1/1) May 26 2013 I should have created this thread in "learning D"...:/
- matovitch (1/1) May 26 2013 up ?
- Mr. Anonymous (2/3) May 26 2013 I think you'd better repost it on digitalmars.D.learn.
- =?UTF-8?B?QWxpIMOHZWhyZWxp?= (13/20) May 26 2013 A single space character in the format specifier is a placeholder for
- matovitch (2/14) May 27 2013 Great ! Thanks a lot.
Hello, I am writting a simple parser for .obj file (mesh) and I would like to read 3 floats like this : 1.1 2.2 3.3 So I tried file.readf("%*[ \n\t]%f%*[ \n\t]%f%*[ \n\t]%f",&x, &y, &z); who works with C function scanf but doesn't work here. Is there a simple way to parse this text ? It is said in std.format that "It's comparable to C99's vsprintf()". So it is useful for writting but it would have been great to have an other format to read which would support regexp. Thanks.
May 26 2013
I should have created this thread in "learning D"...:/
May 26 2013
On Sunday, 26 May 2013 at 22:07:29 UTC, matovitch wrote:up ?I think you'd better repost it on digitalmars.D.learn.
May 26 2013
On 05/26/2013 05:03 AM, matovitch wrote:I am writting a simple parser for .obj file (mesh) and I would like to read 3 floats like this : 1.1 2.2 3.3 So I tried file.readf("%*[ \n\t]%f%*[ \n\t]%f%*[ \n\t]%f",&x, &y, &z); who works with C function scanf but doesn't work here. Is there a simple way to parse this text ?A single space character in the format specifier is a placeholder for zero or more whitespace characters: import std.stdio; void main() { float x; float y; float z; auto file = File("deneme.txt"); file.readf(" %s %s %s", &x, &y, &z); } Ali
May 26 2013
On Sunday, 26 May 2013 at 23:32:36 UTC, Ali Çehreli wrote:A single space character in the format specifier is a placeholder for zero or more whitespace characters: import std.stdio; void main() { float x; float y; float z; auto file = File("deneme.txt"); file.readf(" %s %s %s", &x, &y, &z); } AliGreat ! Thanks a lot.
May 27 2013