473,394 Members | 1,701 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

line parsing issue

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
2 1037
"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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Kemal | last post by:
Hi, I have an xml file which I cant change, the problem is that the first line looks like this <?xml version="1.0" ?> with the rest of the xml being fine. However when I try to parse this I am...
4
by: Boogie El Aceitoso | last post by:
Hi, I need a command line parser that understands filename swith spaces. Since I'm absolutelly sure I'm not the first developer to need a command line parser, I was wondering is there's a...
5
by: Mike Mimic | last post by:
Hi! I am programming small program which would use its own text based network protocol. I come to the problem with ending lines. I was thinking about ending them with \r\n combination. But the...
40
by: Abby | last post by:
My .dat file will contain information like below. /////////// First 0x04 0x05 0x06 Second 0x07
3
by: David Svoboda | last post by:
I have a server program that takes commands and acts on them. The server program can also take these commands from an input file or standard input (mainly for testing purposes). As such, I often...
8
by: Andrew Robert | last post by:
Hi Everyone. I tried the following to get input into optionparser from either a file or command line. The code below detects the passed file argument and prints the file contents but the...
13
by: Chris Carlen | last post by:
Hi: Having completed enough serial driver code for a TMS320F2812 microcontroller to talk to a terminal, I am now trying different approaches to command interpretation. I have a very simple...
2
by: =?Utf-8?B?UmFtb24gR2VuZQ==?= | last post by:
Hello: I am building a console application and I am having an issue with the command line arguments. A couple of my arguments are paths and they are usually enclosed in double quotes. If one of...
15
by: puzzlecracker | last post by:
What is the quickest way to check that the following: const line; only contains whitespace, in which case to ignore it. something along these lines: isspacedLine(line); Thanks
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.