![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
![]() |
| |
| | #1 (permalink) |
| | Chomp Echo String; No New Line Please! When I do this: WScript.Echo (strEighthLine & ipAddress) I get a string of text on one line, and then an IP address on the next line. How can I print this so that there's *not* a newline in between? I want my text, and then the IP address all on the same line. -todd |
My System Specs![]() |
| | #2 (permalink) |
| | Re: Chomp Echo String; No New Line Please! Todd wrote: Quote: > When I do this: > > WScript.Echo (strEighthLine & ipAddress) > > I get a string of text on one line, and then an IP address on the next > line. How can I print this so that there's *not* a newline in > between? I want my text, and then the IP address all on the same > line. NewLine (vbCrLf). For example, if you code: ========= Wscript.Echo strEighthLine Wscript.Echo strEighthLine ======= There will be a blank line separating the two lines. If you cannot fix the code that assigns a value to strEighthLine, maybe you can strip off the last 2 characters. For example: strEightLine = Left(strEightLine, Len(strEighthLine) - 2) This assumes there are actually two trailing characters, the Carriage Return and the Line Feed. -- Richard Mueller MVP Directory Services Hilltop Lab - http://www.rlmueller.net -- |
My System Specs![]() |
| | #3 (permalink) |
| | Re: Chomp Echo String; No New Line Please! Richard Mueller wrote: Quote: > Todd wrote: > Quote: > > When I do this: > > > > WScript.Echo (strEighthLine & ipAddress) > > > > I get a string of text on one line, and then an IP address on the next > > line. How can I print this so that there's *not* a newline in > > between? I want my text, and then the IP address all on the same > > line. > The value assigned to the variable strEighthLine must include a trailing > NewLine (vbCrLf). For example, if you code: > ========= > Wscript.Echo strEighthLine > Wscript.Echo strEighthLine > ======= > There will be a blank line separating the two lines. If you cannot fix the > code that assigns a value to strEighthLine, maybe you can strip off the Quote: > 2 characters. For example: > > strEightLine = Left(strEightLine, Len(strEighthLine) - 2) > > This assumes there are actually two trailing characters, the Carriage Quote: > and the Line Feed. beginning of the latter variable. The following removes them regardless of location. tmp = strEighthLine & ipAddress tmp = Replace(tmp, Chr(13), "") tmp = Replace(tmp, Chr(10), "") WScript.Echo tmp -- Todd Vargo (Post questions to group only. Remove "z" to email personal messages) |
My System Specs![]() |
| | #4 (permalink) |
| | Re: Chomp Echo String; No New Line Please! Beautiful. Thanks Richard. Thanks Todd. -todd |
My System Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| wscript.echo only a new line / embed a "CR" in a text string ? | VB Script | |||
| Need full line of text from select-string | PowerShell | |||
| Write every line except the one with first occurence of a string | PowerShell | |||
| Search for string in CSV and delete line if string found in line | PowerShell | |||
| Getting the next line after a string | PowerShell | |||