?
Solved

Write lines in a txt using vbs vertically instead of horizontally

Posted on 2009-05-11
3
Medium Priority
?
453 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
[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
  • Learn & ask questions
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 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

Open in new window

0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

This is an addendum to the following article: Acitve Directory based Outlook Signature (http://www.experts-exchange.com/Programming/Languages/Visual_Basic/VB_Script/Q_24950055.html) The script is fine, and works in normal client-server domains…
This script will sweep a range of IP addresses (class c only, 255.255.255.0) and report to a log the version of office installed. What it does: 1.)      Creates log file in the directory the script is run from (if it doesn't already exist) 2.)      Sweep…
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
Suggested Courses

762 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