Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
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

Why not load it into Notepad and use the inbuilt search and replace function. Sgouldn't take more than a couple of minutes.
Stuart

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 appreciatedKind Regards,
Yelena

![]() |
OS shutdown on cmd mode
|
update ms servers
|

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |