MathGroup Archive 2007

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: remove whitespace

  • To: mathgroup at smc.vnet.net
  • Subject: [mg82584] Re: remove whitespace
  • From: Jean-Marc Gulliet <jeanmarc.gulliet at gmail.com>
  • Date: Thu, 25 Oct 2007 06:10:40 -0400 (EDT)
  • Organization: The Open University, Milton Keynes, UK
  • References: <ffn0pa$5uf$1@smc.vnet.net>

vickyisai at gmail.com wrote:

> I have a txt file and i want to remove all whitespaces in that file .
> I am trying to get a list of all characters in that file ..and it
> takes whitespace too,which i wnat to eleminate.
> 
> I used ReadList which works as I want, but it takes all
> whitespaces,....
> How can i overcome this problem.
> 
> I use Mathematica 5.2

You could use *StringReplace*.

In[1]:= data = {"The Quick Brown", "Fox Jump Over", "The Lazy Dog."};

In[2]:= StringReplace[data, Whitespace -> ""]

Out[2]= {"TheQuickBrown", "FoxJumpOver", "TheLazyDog."}

Regards,
-- 
Jean-Marc


  • Prev by Date: eigenvectors is taking lot of time
  • Next by Date: Re: Gradient of a List
  • Previous by thread: Re: remove whitespace
  • Next by thread: (x|y) \[element] Integers in Reduce function