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 


other code question
Goto page 1, 2  Next
 
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help
View previous topic :: View next topic  
Author Message
tim6389
Professional Member
Professional Member


Joined: 01 Aug 2002
Posts: 790

PostPosted: Thu Aug 01, 2002 5:47 am    Post subject: other code question Reply with quote

i have just learned the dos can not stdout out right Sad

what i mean is if i try this

tail -f cardout.dat <----- this works outputs it to the screen BUT

if i do this

tail -f cardout.dat | perl4 parse.pl /4 /olog.txf <---this won't work cuase dos can't pipe it out right ( when using the -f command whick i need)


any vds code that i can uses so i can fix this problem Smile


thanks
Back to top
View user's profile Send private message
Mac
Professional Member
Professional Member


Joined: 08 Jul 2000
Posts: 1585
Location: Oklahoma USA

PostPosted: Thu Aug 01, 2002 7:10 am    Post subject: Reply with quote

For DOS output to a file, use:

> (overwrites/creates the destination file)

>> (appends to the destination file)

Example:
dir/s > test.dat

dir/s >> test.dat

Cheers, Mac Smile

_________________
VDSug.dll does file IO, check/disable menu items,
non-VDS dlls, draw functions and more...
Free download (30k dll size) at:
http://www.vdsworld.com/download.php?id=361
Back to top
View user's profile Send private message Send e-mail
tim6389
Professional Member
Professional Member


Joined: 01 Aug 2002
Posts: 790

PostPosted: Thu Aug 01, 2002 2:03 pm    Post subject: right Reply with quote

but i need the tail -f so that it will watch the file as it grows, and it will feed the data TO the perl script if i just have it save to a file then the perl script will stop runing when it get to the end of the file Sad this is what tail -f does it let's the data to be feed to the perl script " like a live feed"

hard to explain Sad BUT does don't have a stdout like linux does.
Back to top
View user's profile Send private message
Mac
Professional Member
Professional Member


Joined: 08 Jul 2000
Posts: 1585
Location: Oklahoma USA

PostPosted: Thu Aug 01, 2002 8:38 pm    Post subject: Reply with quote

I'm not familiar with the program and don't understand exactly
what you want to do. However, if the DOS command:

tail -f cardout.dat

prints the correct results to screen, the following will print the
same results to output.txt (or any file name you choose):

tail -f cardout.dat > output.txt

If you need to continously add info to the file, you can use a
loop with ">>" like this:

tail -f cardout.dat >> output.txt

NOTE: In DOS, if you use a filename or command with spaces,
it may need to be enclosed in quotes.

If this still is not what you need, maybe you can try to explain
step by step (in more detail) what your program does, and what
you're trying to do. We'll need to know that before we can
come up with a solution in either DOS or VDS...

Cheers, Mac Smile

_________________
VDSug.dll does file IO, check/disable menu items,
non-VDS dlls, draw functions and more...
Free download (30k dll size) at:
http://www.vdsworld.com/download.php?id=361
Back to top
View user's profile Send private message Send e-mail
tim6389
Professional Member
Professional Member


Joined: 01 Aug 2002
Posts: 790

PostPosted: Thu Aug 01, 2002 11:05 pm    Post subject: yes Reply with quote

ok i know you are talking to say BUT the file option won't work also ( i tried it) what i need is a vds program that will do this:


take the output from tail -f and feed that output to the perl script,


the reason the >> won't work cause dos pipe command is lacking the Ability to DO a live feed and feed it to the perl script. the program that i run gathers data then i used the perl script to convert that data to english, well english for me that is. this must be done DURing live feed other wise the data would be repeated...that is why i uses tail -f it watchs the file as it grows, thus making it not repeat the info

hard to explain...


i hope i explain it better
Back to top
View user's profile Send private message
Tommy
Admin Team


Joined: 16 Nov 2002
Posts: 746
Location: The Netherlands

PostPosted: Thu Aug 01, 2002 11:12 pm    Post subject: Reply with quote

How about launching the Perl script directly and modifying the Perl script to directly read
the data from an output file created by "tail" and to directly write the final output file?
Back to top
View user's profile Send private message Send e-mail Visit poster's website
tim6389
Professional Member
Professional Member


Joined: 01 Aug 2002
Posts: 790

PostPosted: Thu Aug 01, 2002 11:51 pm    Post subject: hummm Reply with quote

that might work, but i have alot of option that are in the perl script which can make it hard to run the Perl script directly. some of the option are:


#Useage:
#
# <logfile> \0 only new cmd82's and C9's data display
# <logfile> \1 all cmd82's and C9's data display
# <logfile> \2 all cmd82's and C9's packet and data display
# <logfile> \3 all parsed packets display
# <logfile> \4 all cmd82's and c9's in all INS40
# <logfile> \5 all cmd82's and c9's fully disassembled


also reading the ouput directly can cause problems like :

one when the program is waiting to get data before it can write in this case the perl script would stop.. beacuse it would think its at the end of the file Smile this is why tail -f comes to play
Back to top
View user's profile Send private message
iMPA
Newbie


Joined: 26 May 2001
Posts: 9
Location: Spain

PostPosted: Fri Aug 02, 2002 12:48 am    Post subject: Reply with quote

what about a DOS batch file, first run the tail program and then the perl script...

Code:

tail -f cardout.dat > output.txt
perl4 parse.pl /4 /output.txf


maybe Question
Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger
tim6389
Professional Member
Professional Member


Joined: 01 Aug 2002
Posts: 790

PostPosted: Fri Aug 02, 2002 1:22 am    Post subject: but Reply with quote

iMPA

i try that BUT this:

Code:
tail -f cardout.dat > output.txt
perl4 parse.pl /4 /output.txf


it nevers goes to the second line BECASUSE the first line never Finishes...if you follow what i mean....
Back to top
View user's profile Send private message
SnarlingSheep
Professional Member
Professional Member


Joined: 13 Mar 2001
Posts: 759
Location: Michigan

PostPosted: Fri Aug 02, 2002 1:43 am    Post subject: Reply with quote

I don't really know what "tail" does..or anything about perl for that matter but, you might try something along the lines of repeatedly running tail -f cardout.dat with the perl script open.

Code:

:evloop
%%Num = 0
repeat
  RUN tail -f cardout.dat
  if @EQUAL(%%Num,0)
    RUN perl4 parse.pl /4 /output.txf
    %%Num = @SUCC(%%Num)
  end
  %%Event = @event()
  wait 0.1
until %%Event
goto %%Event

Just a shot in the dark here though..

_________________
-Sheep
My pockets hurt...
Back to top
View user's profile Send private message Send e-mail
tim6389
Professional Member
Professional Member


Joined: 01 Aug 2002
Posts: 790

PostPosted: Fri Aug 02, 2002 2:11 am    Post subject: hummmm Reply with quote

SnarlingSheep



what tail -f does is this :

"monitors a file as it grows. Every two seconds, tail wakes up and displays any new data at the end of the file. This flag is ignored if reading from the standard input and standard input is a pipe."


so what i need is a way to have vds take the tail -f cardout.txt - this is display in a dos window and feed this info into perl.. now i see that in your script you have this:

Code:
run perl4 parse.pl /4 /output.txf


i need to pipe ( | ) the output of the vds to perl

if i was to run what you have i would get a error in perl becuase of the following

1. NO input file is specifed or beacuse THERE is nothing being pipe to the perl script
Back to top
View user's profile Send private message
tim6389
Professional Member
Professional Member


Joined: 01 Aug 2002
Posts: 790

PostPosted: Fri Aug 02, 2002 4:13 pm    Post subject: hummm Reply with quote

anyone have any other ideas Smile
Back to top
View user's profile Send private message
iMPA
Newbie


Joined: 26 May 2001
Posts: 9
Location: Spain

PostPosted: Fri Aug 02, 2002 4:51 pm    Post subject: Reply with quote

Maybe using the vdsconsole.dll?
It provides Visual DialogScript the ability to provide communication between a console application and their script.

good luck !!

_________________
share what you know, learn what you don't
Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger
tim6389
Professional Member
Professional Member


Joined: 01 Aug 2002
Posts: 790

PostPosted: Fri Aug 02, 2002 4:56 pm    Post subject: hummmm Reply with quote

is that dll freeware?
Back to top
View user's profile Send private message
Skit3000
Admin Team


Joined: 11 May 2002
Posts: 2166
Location: The Netherlands

PostPosted: Fri Aug 02, 2002 5:06 pm    Post subject: Reply with quote

If you want to know if a dll is freeware or not, search for it on vdsworld... If there isn't a Price: label it's free...
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help All times are GMT
Goto page 1, 2  Next
Page 1 of 2

 
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