Solved

Write lines in a txt using vbs vertically instead of horizontally

Posted on 2009-05-11
3
443 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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I met Paul Devereux (@pdevereux) today when I responded to his tweet asking “Anybody know how to automate adding files from disk to a folder in #outlook  ?”.  I replied back and told Paul that using automation, in this case scripting, to add files t…
This is pretty cool.  The purpose of this VB Script is to help you document where JAR (Java ARchive) files and specifically java class files are located so that you can address issues seen with a client or that you can speak intelligently with a dev…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

773 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