forum.vdsworld.com Forum Index forum.vdsworld.com
Visit VDSWORLD.com
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Read documents line-by-line to be used as single parameters

 
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help
View previous topic :: View next topic  
Author Message
Zeitenwanderer
Newbie


Joined: 26 Feb 2002
Posts: 10

PostPosted: Thu Feb 28, 2002 8:47 pm    Post subject: Read documents line-by-line to be used as single parameters Reply with quote

Hi,


I would need to read a txt-file containing maybe 100 lines, each line should become a parameter to be sent one by one to a window.
Anybody have source or an idea how to do that? Smile


Cheers,

Jörg
Back to top
View user's profile Send private message Send e-mail Visit poster's website
SnarlingSheep
Professional Member
Professional Member


Joined: 13 Mar 2001
Posts: 759
Location: Michigan

PostPosted: Thu Feb 28, 2002 9:54 pm    Post subject: Reply with quote

Maybe something like this.
__________________________________________________________________________________________________________________________
Code:

LIST CREATE,1
REM Load your text file into List #1
LIST LOADFILE,1,C:\Path\TextFile.txt
%%Number = 0
repeat
  REM Change this to send the current line of text to your Window.
  REM Not sure how you want it sent,
  REM If as regular text try: WINDOW SEND,@WINEXISTS(WindowTitleHere),@ITEM(1,%%Number)
  info Send to window: @ITEM(1,%%Number)
  REM Increase %%Number by 1 to move to the next line of text.
  %%Number = @SUCC(%%Number)
until @EQUAL(%%Number,@COUNT(1))

_________________
-Sheep
My pockets hurt...
Back to top
View user's profile Send private message Send e-mail
bjdavis
Valued Newbie


Joined: 03 Jan 2002
Posts: 28
Location: Jacksonville, FL

PostPosted: Fri Mar 01, 2002 12:15 am    Post subject: Reply with quote

You will also need to step through each item of the list

Code:

******* Modified code written by: SnarlingSheep ************
LIST CREATE,1
REM Load your text file into List #1
LIST LOADFILE,1,C:\Path\TextFile.txt

  REM ********************************
  REM Added By: B.J. Davis
  REM Start at the TOP of the List 1
  REM If the list is NOT Empty
 
  If @Greater(@Count(1),0)
 
     REM ********************************

   %%Number = 0
   repeat
     REM Change this to send the current line of text to your Window.
     REM Not sure how you want it sent,
     REM If as regular text try: WINDOW SEND,@WINEXISTS(WindowTitleHere),@ITEM(1,%%Number)
     info Send to window: @ITEM(1,%%Number)
     REM Increase %%Number by 1 to move to the next line of text.
     %%Number = @SUCC(%%Number)
 
     REM *********************************
     REM Added By: B.J. Davis
     REM Move to the Next Item in the List
 
     %%NextItem = @Next(1)
 
     REM *********************************
   until @EQUAL(%%Number,@COUNT(1))

     REM ********************************
     REM Added By: B.J. Davis
     REM If List 1 is Empty your code will move to this point
 
  END
 
  REM ********************************

_________________
B.J. Davis, MCSE
Back to top
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger
SnarlingSheep
Professional Member
Professional Member


Joined: 13 Mar 2001
Posts: 759
Location: Michigan

PostPosted: Fri Mar 01, 2002 1:51 am    Post subject: Reply with quote

@ITEM(1,%%Number) will return the item in List 1 at position %%Number.
No need for SEEK or @NEXT()

_________________
-Sheep
My pockets hurt...
Back to top
View user's profile Send private message Send e-mail
bjdavis
Valued Newbie


Joined: 03 Jan 2002
Posts: 28
Location: Jacksonville, FL

PostPosted: Fri Mar 01, 2002 4:30 am    Post subject: Reply with quote

You are correct ... Rolling Eyes I overlooked that line. 8O Thanks Very Happy
_________________
B.J. Davis, MCSE
Back to top
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger
Zeitenwanderer
Newbie


Joined: 26 Feb 2002
Posts: 10

PostPosted: Fri Mar 01, 2002 8:10 pm    Post subject: Does the trick it seems Reply with quote

Well, yes, this seems to do the trick. Thanks to you two guys. I doubt, I would have ever made it that far Smile

Now I am tricking around the other part. Stay tuned and keep the way you are!!!

Yours grateful,

Jörg (pronounce George)
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum

Twitter@vdsworld       RSS

Powered by phpBB © 2001, 2005 phpBB Group