Replace spaces with

August 19, 2009 at 07:59:09
Specs: Windows XP
I need to reformat a text file:

To change it from :

1 35627.52 0.60 ---------- 245.65 ----------
2 36176.54 1.27 ---------- 249.44 ----------
3 35669.11 1.64 325.62 245.94 2.25
4 35928.33 3.03 35124.00 247.73 242.18
5 35490.21 4.85 33769.26 244.70 232.84


to :


1,35627.52,0.60,0,245.65,0
2,36176.54,1.27,0,249.44,0
3,35669.11,1.64,325.62,245.94,2.25
4,35928.33,3.03,35124.00,247.73,242.18
5,35490.21,4.85,33769.26,244.70,232.84


I need to
1. delete all leading spaces
2. replace all spaces with ','
3. replace '----------' witth '0'

Could you please help with the code?

Yelena


See More: Replace spaces with

Report •


#1
August 19, 2009 at 09:42:24
Why not load it into Notepad and use the inbuilt search and replace function. Sgouldn't take more than a couple of minutes.

Stuart


Report •

#2
August 19, 2009 at 10:36:29
Sorry, I did not explain what exactly I need.
There will be a lot of files similar to this created by testing device. I need a script that will re-format these files as they appear in the direcory and move to other directory from which they will be fetched by the real time application. There were more filtering required and somebody (Ivo) on this forum helped me with it. Original file has some lines at the beginning and the end that needed to be deleted. Now I need more.
Any help will be greatly appreciated

Kind Regards,
Yelena


Report •

#3
August 19, 2009 at 11:50:43
Programming Forum??

There is nothing to learn from someone who already agrees with you.


Report •

Related Solutions

#4
August 19, 2009 at 11:56:26

Report •


Ask Question