Re: Split a file into multiple files using a pattern

• To: mathgroup at smc.vnet.net
• Subject: [mg69700] Re: Split a file into multiple files using a pattern
• From: "Jens-Peer Kuska" <kuska at informatik.uni-leipzig.de>
• Date: Thu, 21 Sep 2006 07:29:30 -0400 (EDT)
• Organization: Uni Leipzig
• References: <eeqqnq\$ooo\$1@smc.vnet.net>

```Hi.

lst = {1, 2, 3, 4, Table[-999.99 , {19}], 5, 6, 7,
8};

lst /. {a___, {(-999.99) ..}, b__} :> {{a}, {b}}

???

Regards

Jens

"Raj" <rajanikanth at gmail.com> schrieb im
Newsbeitrag news:eeqqnq\$ooo\$1 at smc.vnet.net...
| hi!
|
| COuld somebody please tell me how can I do this
in Mathematica: I have
| a file of numbers containing -999.99 in places
where there is missing
| data.
| I want to split the file into a number of files
based on the criterion
| that the number of consecutive - 999.99 are more
than 18 .
|
| For example... if the file is of the form
|
| {1,2,3,4,{-999.99 repeated 18 or more
times},5,6,7,8}
| then I want the output to be file1.txt which
contains {1,2,3,4} and
| file2.txt which contains {5,6,7,8}
|
| Thanks,
|
| Raj
|

```

• Prev by Date: Re: Inequalities
• Next by Date: Re: Re: General--Mathematica and Subversion
• Previous by thread: Split a file into multiple files using a pattern
• Next by thread: Re: Split a file into multiple files using a pattern