Jump to content
Sign in to follow this  
gunmaster

Removing spaces

Recommended Posts

gunmaster

I have got a File in which i store some data.

eg,This is a party and i want a drink.

The spaces are at random places.I want to remove the spaces between the words and add a comma.

There mey be more than one space between two words.

Can anybody help me?

Edited by gunmaster

Share this post


Link to post
Share on other sites
BigDod

I have got a File in which i store some data.

eg,This is a party and i want a drink.

The spaces are at random places.I want to remove the spaces between the words and add a comma.

There mey be more than one space between two words.

Can anybody help me?

If you was using version 3 this is how I would do it

$text = StringStripWS("this is   a   line   of   text", 4)
$text1 = StringReplace($text, " ", ",")
MsgBox(0, "New string is", $text1)


Get Beta versions Here Get latest SciTE editor Here AutoIt 1-2-3 by Valuater - A great starting point.

Time you enjoyed wasting is not wasted time ......T.S. Elliot
Suspense is worse than disappointment................Robert Burns
God help the man who won't help himself, because no-one else will...........My Grandmother

Share this post


Link to post
Share on other sites
Helge

I can say pretty certain that it ain't possible directly with v2, but there might be command line

program that can do what you want...

If you can't find any, I'm sure someone here at the forum are happy to create one in v3 for you.

Of course, you can also simply just change to v3 :P

Share this post


Link to post
Share on other sites
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.