Solved

Write lines in a txt using vbs vertically instead of horizontally

Posted on 2009-05-11
3
440 Views
Last Modified: 2012-05-06
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
Comment
Question by:johnnyjonathan
3 Comments
 

Expert Comment

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

Expert Comment

by:yehudaha
ID: 24353194
Ma Kore johnny ?

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

Accepted Solution

by:
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

Open in new window

0

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

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…

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now