Solved

# Write lines in a txt using vbs vertically instead of horizontally

Posted on 2009-05-11
440 Views
hi,
i know the vbs commands to output words\text into a .txt file regulary.
is there any command to write it vertically ?
so that "i want to go" will be
i
want
to
go
0
Question by:johnnyjonathan

Expert Comment

ID: 24353193
Yes it is possible. Send your code. I'll modify it.
0

LVL 14

Expert Comment

ID: 24353194
Ma Kore johnny ?

What you trying to do ?
there maybe a number of ways.
0

LVL 5

Accepted Solution

karstieman earned 500 total points
ID: 24353250
Read the string to be written char by char.
if char = " " then write a new line

I don't know in vbscript, but this is how it works in vb.net

 Dim youroutputstring As String = "I want to go"

Dim stringlength As Integer = YourOutputString.length

Dim p As Integer = 1

Dim a As Integer = 1

Do Until p = stringlength

If Mid(youroutputstring, p, 1) = " " Then

' write word to file

' test with: msgbox(Mid(youroutputstring, a, (p - a)))

' WRITE WITH YOUR OWN CODE: Mid(youroutputstring, a, (p - a)) & vbcrlf

a = p

End If

p = p + 1

Loop

' print last word also

' test with: MsgBox(Mid(youroutputstring, a, (p + 1 - a)))

' WRITE WITH YOUR OWN CODE: Mid(youroutputstring, a, (p - a)) & vbcrlf

0

## Featured Post

Welcome, welcome!  If you are new to the series and haven't been following along, please take a brief moment to review the first three installments: Part 1 (http://www.experts-exchange.com/Programming/Languages/Visual_Basic/VB_Script/A_266-VBScri…
Over the years I have built up my own little library of code snippets that I refer to when programming or writing a script.  Many of these have come from the web or adaptations from snippets I find on the Web.  Periodically I add to them when I come…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…