line parsing issue

  • Thread starter Thread starter James D. Marshall
  • Start date Start date
J

James D. Marshall

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.
 
James D. Marshall said:
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, ",")
///
 
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top