Re: Import numerical data and split by pattern
- To: mathgroup at smc.vnet.net
- Subject: [mg94454] Re: Import numerical data and split by pattern
- From: Jens-Peer Kuska <kuska at informatik.uni-leipzig.de>
- Date: Sun, 14 Dec 2008 07:35:12 -0500 (EST)
- References: <ghtjl9$rfu$1@smc.vnet.net>
Hi
str = "## a b c
1 1.0
2 2.0
# d e f
3 3.0
4 4.0
## c d e
5 5.0
6 6.0";
Partition[
Select[ImportString[str, "Table"] , VectorQ[#, NumericQ] &],
2
]
??
Regards
Jens
Gehricht at googlemail.com wrote:
> Hi!
>
> I am asking this more out of curiosity, but is there a neat way to
> accomplish the following task within Mathematica.
> Suppose I have a file as follows
> ## a b c
> 1 1.0
> 2 2.0
> # d e f
> 3 3.0
> 4 4.0
> ## c d e
> 5 5.0
> 6 6.0
> ...
> Now I want everything between ## and # in a separate list, i.a. list1=
> {{1,1.0},{2,2.0}}, list2={{5,5.0},{6,6.0}}, etc.
> How could I get this?
> With thanks in advance
> Yours Wolfgang
>