Solved

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

Posted on 2009-05-11
448 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
[X]
###### Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

• Help others & share knowledge
• Earn cash & points

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

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…
Deploying a Microsoft Access application in a Citrix environment is not difficult but takes a few steps. However, Citrix system people are often of little help, as they typically know next to nothing about Access. The script provided here will take …
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial
Finding and deleting duplicate (picture) files can be a time consuming task. My wife and I, our three kids and their families all share one dilemma: Managing our pictures. Between desktops, laptops, phones, tablets, and cameras; over the last decade…
###### Suggested Courses
Course of the Month7 days, 5 hours left to enroll