formattedRead can't work with tab delimiter input

Ky-Anh Huynh saigon at example.net
Tue Sep 19 13:28:22 UTC 2017


Hi,

I want to read two fields from STDIN

     string key;
     double value;
     line_st.formattedRead!"%s %f"(key, value);

However, if the input line contains \t and it doesn't contain any 
space, the code doesn't work as expected. If there is a space, it 
works well

    a[space]1         # work, key => a, value => 1
    b[space][tab]2    # work, key => b, value => 2
    c[tab]3           # not work, key => c[tab]3, value => nan

Can you please help? Thanks a lot.


PS: My program is found here

https://github.com/icy/dusybox/blob/master/src/plotbar/main.d#L59


More information about the Digitalmars-d-learn mailing list