RE: eliminate some characters inside a file
- To: mathgroup at smc.vnet.net
- Subject: [mg34723] RE: [mg34716] eliminate some characters inside a file
- From: "Annetts, Dave (E&M, North Ryde)" <David.Annetts at csiro.au>
- Date: Mon, 3 Jun 2002 01:46:43 -0400 (EDT)
- Sender: owner-wri-mathgroup at wolfram.com
Hi,
> this is my question: I´ve got a large numbers o files with the next
> appearance:
>
> "12,56,12,14"
> "13,56,25,36"
> "14,58,465,7"
> .
> .
> .
>
> and I need Mathemathica to eliminate " " and changes , by
> blank space to
> obtain the next:
> 12 56 12 14
> 13 56 25 36
> 14 58 465 7
> .
> .
> .
> If anybody can help me I would be very pleased
Read the file into a list of strings, then StringReplace[#, {","->" "}]& ...
However, if you're going to do this with a large number of files, you might
be better off with a stream editor such as sed. And perhaps a better
suggestion is to correct it at the source, if at all possible.
Regards,
Dave.
--------------------------------------------------------
Dr. David Annetts EM Modelling Analyst
Tel: (+612) 9490 5416 CSIRO DEM, North Ryde
Fax: (+612) 9490 5467 David.Annetts at csiro.au
Include "usual_disclaimers"
--------------------------------------------------------