I guess the string you are working with is something like a
a=.' 0',TAB,'3',TAB,'34',LF,'0',TAB,'1',TAB,'3e-3'
a
0 3 34
0 1 3e-3
0".a
0
require'misc'
chop a
┌───────┬────────┐
│ 0 3 34│0 1 3e-3│
└───────┴────────┘
0". each chop a
┌─┬─┐
│0│0│
└─┴─┘
0".each >TAB chop each chop a
┌─┬─┬─────┐
│0│3│34 │
├─┼─┼─────┤
│0│1│0.003│
└─┴─┴─────┘
>0".each >TAB chop each chop a
0 3 34
0 1 0.003
2006/9/26, Bill Harris <[EMAIL PROTECTED]>:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Pascal Jasmin <[EMAIL PROTECTED]> writes:
> 0 ". (".^:_1) (3 2 $ 0 3 34 0 1 3e_3)
>
> 3e_3 instead of 3e-3 was the prob.
Pascal,
Thanks. Actually, that was the question, not the problem. I knew I had
the '-' in the data (it comes from another source), and the dictionary
entry for Number (dyadic ".) seems to indicate it would make the
conversion. It will, as long as the whitespace in the string consists
of spaces, not tabs.
So I'm stuck with converting the '-' to '_', and I was wondering if the
failure to deal with tabs was a defect in ". or if there were a better
idiom than using detab to eliminate the tabs.
Thanks again,
Bill
- --
Bill Harris http://facilitatedsystems.com/weblog/
Facilitated Systems Everett, WA 98208 USA
http://facilitatedsystems.com/ phone: +1 425 337-5541
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.3 (MingW32)
Comment: For more information, see http://www.gnupg.org
iD8DBQFFGHHy3J3HaQTDvd8RAvs+AJ92XuhW/gM1PKKo6n4xZv3YJE16cgCbB9vv
DNlnIdZ1lQUhjdty8+ia0T4=
=neIW
-----END PGP SIGNATURE-----
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm
--
Björn Helgason, Verkfræðingur
Fugl&Fiskur ehf, Þerneyjarsund 23, Box 127
801 Grímsnes ,t-póst: [EMAIL PROTECTED]
Skype: gosiminn, gsm: +3546985532
Landslags og skrúðgarðagerð, gröfuþjónusta
http://groups.google.com/group/J-Programming
Tæknikunnátta höndlar hið flókna, sköpunargáfa er meistari einfaldleikans
góður kennari getur stigið á tær án þess að glansinn fari af skónum
/|_ .-----------------------------------.
,' .\ / | Með léttri lund verður |
,--' _,' | Dagurinn í dag |
/ / | Enn betri en gærdagurinn |
( -. | `-----------------------------------'
| ) | (\_ _/)
(`-. '--.) (='.'=)
`. )----' (")_(")
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm