Link to home
Start Free TrialLog in
Avatar of bsharath
bsharathFlag for India

asked on

Reduce spaces in between 2 words in txt file

Hi,

I have a txt file which has data like this

Sharath     Sharath.reddy@plc.com

I want the data like this
Sharath Sharath.reddy@plc.com

Regards
Sharath
Avatar of Brian Pierce
Brian Pierce
Flag of United Kingdom of Great Britain and Northern Ireland image

Load it into word  and use filnd/replace to find two spaces and replace with one space - you may need to do the find/replace all several times to get rid of all the double spaces
Avatar of LuckyLuke57
LuckyLuke57

Or more complete:

Do a first find and replace
- search for the tab-character
- replace with one space

Then as KCTS suggested do as much as you need
- search for two spaces
- replace with one spac

Luke
Avatar of bsharath

ASKER

But there are a differerent of space
One have 1 space 2,3,4,5,6,7,8,9, so on....
If you start with 1,2,3,4,5,6,7,8,9 spaces
If you do the find and replace the first time, you will have
1, 2,3,4,5,6,7,8 as a result,
One more time find and replace and you have
1, 2,3,4,5,6,7
and do this as much as is necessary
If you have a lot of spaces, you can start with a find and replace from 5 spaces to one which you do a few times, after that you have to do the 2 to 1 only max 4 times.
ASKER CERTIFIED SOLUTION
Avatar of oBdA
oBdA

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial