Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
Solved

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

Posted on 2009-05-11
Medium Priority
458 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 2000 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

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…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
###### Suggested Courses
Course of the Month10 days, 3 hours left to enroll