[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
unformatted ascii data to arrays
- Subject: unformatted ascii data to arrays
- From: eeeyler(at)my-deja.com
- Date: Mon, 09 Oct 2000 17:20:20 GMT
- Newsgroups: comp.lang.idl-pvwave
- Organization: Deja.com - Before you buy.
- Xref: news.doit.wisc.edu comp.lang.idl-pvwave:21650
I am trying to come up with some regular expressions to help me parse
through this data so it can be loaded into arrays.
The problem is this: String values may contain any character a user can
enter from a keyboard, including whitespace and double quotes in any
location within the string (even first or last character).
Some example (small data files):
Example 1.
real_1 integer_1 integer_2 string_1 real_2 string_2
lbs newtons none none kg none
1.3456 3 500 "a string" 500.2 "another string"
3.2 6 8 " yet another" 5.5 "another yet"
3.5 9 10 "more strings " 67.5 "why?"
6.7 1 5 " one more " 8.5 "I don't know!"
Example 2:
string_1 real_1 real_2 integer_1 string_2 integer_2
none lbs kg newtons none none
"a string" 1.356 500.2 8 "234" 342
" yet one more" 8.88 9.0 4 "sdfh" 13
"here's another " 98.0 3.5 123 "qiour>alkfj" 90
" end example 2 " 67.4 23.9 755 "mzxbv" 56
Example 3:
string_1 real_1 real_2 integer_1 integer_2 string_2
"hi" 12.3 45.6 7 8 "bye"
"am" 90.1 23.4 5 6 " I"
"making" 78.9 13.4 2 5 "sense? "
"please" 68.7 90.8 1 3 " help "
--
Thanks for talking!
Eric
Sent via Deja.com http://www.deja.com/
Before you buy.