By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,775 Members | 1,425 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,775 IT Pros & Developers. It's quick & easy.

line parsing issue

P: n/a
One question on parsing, the line has double carriage returns that show up
as squares, I am seeing this through watch1, how would you code a replace
statement to get rid of these, its driving me batty.

snippet of text line that shows up in watch
USAHOME1 Users NT Advanced Server -  5.1  2600, Service Pack 2 
Uniprocessor Free  Microsoft Windows XP

The problem is that opening it in notepad or excel, the @^^$&()^ carriage
returns do exactly what they are designed to do.

USAHOME1
Users
NT Advanced Server -
5.1
2600, Service Pack 2
Uniprocessor Free
Microsoft Windows XP

The output is from a program called srvinfo.exe, so I have little control
over its formatting.

What I need to do is figure out how to replace the carriage returns with
commas. I have already filtered, parsed out a lot of the text that I do not
need, except the carriage returns.
Nov 21 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
"James D. Marshall" <cr**********@hotmail.com> schrieb:
What I need to do is figure out how to replace the carriage returns with
commas. I have already filtered, parsed out a lot of the text that I do
not need, except the carriage returns.


\\\
s = Replace(s, ControlChars.Cr, ",")
///

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>

Nov 21 '05 #2

P: n/a
James,

When the sample from Herfried does not work, you can try as well something
as

\\\
s = Replace(s, VBCRLF, ",")
///

I am in doubt if the CR is the same as the CR and LF however did not check
it on MSDN that is all.

Cor

"James D. Marshall" <cr**********@hotmail.com>
One question on parsing, the line has double carriage returns that show up
as squares, I am seeing this through watch1, how would you code a replace
statement to get rid of these, its driving me batty.

snippet of text line that shows up in watch
USAHOME1 Users NT Advanced Server -  5.1  2600, Service Pack 2
 Uniprocessor Free  Microsoft Windows XP

The problem is that opening it in notepad or excel, the @^^$&()^ carriage
returns do exactly what they are designed to do.

USAHOME1
Users
NT Advanced Server -
5.1
2600, Service Pack 2
Uniprocessor Free
Microsoft Windows XP

The output is from a program called srvinfo.exe, so I have little control
over its formatting.

What I need to do is figure out how to replace the carriage returns with
commas. I have already filtered, parsed out a lot of the text that I do
not need, except the carriage returns.

Nov 21 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.