#180663 - 2007-09-18 09:07 AM
Problem with ReadFileTail Function
|
ddady
Getting the hang of it
Registered: 2006-09-03
Posts: 98
|
Good Morning to ALL.
I have used the ReadFileTail function and it works great. My problem starts when i'm trying to use the script on my DC. I have tried the script on my local machine and everything works well then i copied the script to the DC and made the relevant changes and it doesn't read the lines in the file. It seems that there is problem reading from this particular file since it works on a different file. The file i wanr to read from is a regular log file with the archive attribute.
here are the relevan code lines:
$text = ReadFileTail ("N:\RetalixLogs\datam.log", 10)
WriteFile ("N:\RetalixLogs\DataCheck.txt", $text)
PrintTo2 ("N:\RetalixLogs\DataCheck.txt","\\dc\OkiSvn")
I'm trying to read the 10 last lines from the 'datam.log' file and to write them into the 'DataCheck.txt' file and to print it. As i mentioned at the begining with defferent files it works great, any suggestions will be appriciated.
|
Top
|
|
|
|
#180667 - 2007-09-18 10:35 AM
Re: Problem with ReadFileTail Function
[Re: Jochen]
|
ddady
Getting the hang of it
Registered: 2006-09-03
Posts: 98
|
Mart, sorry i didn't know, wont happen again.
Jochen, i will try it and will post the results.
|
Top
|
|
|
|
#180668 - 2007-09-18 10:47 AM
Re: Problem with ReadFileTail Function
[Re: ddady]
|
ddady
Getting the hang of it
Registered: 2006-09-03
Posts: 98
|
That's is the error i'm getting
"urred 24 [The program issued a command but the command length is incorrect.] occ"
|
Top
|
|
|
|
#180671 - 2007-09-18 01:29 PM
Re: Problem with ReadFileTail Function
[Re: Jochen]
|
ddady
Getting the hang of it
Registered: 2006-09-03
Posts: 98
|
Ok, It opens the content of the 'datam.log' file in a command window.
Could it be that this function can't handle a file with 796 lines?
I'm just guessing here since it workd perfect on a file with 50 lines.
The instructions on this function says that there is no limit or if i missunderstood 1000 lines. But still i need only 10 lines which is the default.
ReadFileTail()
|
Top
|
|
|
|
#180673 - 2007-09-18 03:05 PM
Re: Problem with ReadFileTail Function
[Re: Mart]
|
ddady
Getting the hang of it
Registered: 2006-09-03
Posts: 98
|
Ok, i think i found out something interesting.
The original file i'm trying to read from is with 796 lines. I have deleted line from there until i reached 500 lines and WALLA, it works!
SO i guess the function cant handle more than that which is very strange [and here is the knockout] i have created a whole different file and put into it 793 lines and it worked so i realy frustrated.
Any Ideas ????????
|
Top
|
|
|
|
#180676 - 2007-09-18 04:26 PM
Re: Problem with ReadFileTail Function
[Re: Jochen]
|
ddady
Getting the hang of it
Registered: 2006-09-03
Posts: 98
|
I didn't see any special characters. Anyway i manage to work around it with the ReadFile() Function
The printing of the lines is not nice as it comes out from the other function but it works. If there is a way to arrange the 5 lines that way they would come out in separate lines insted of all 5 lines in one line i will be more than glad to hear about it.
|
Top
|
|
|
|
#180682 - 2007-09-18 06:19 PM
Re: Problem with ReadFileTail Function
[Re: Jochen]
|
Witto
MM club member
Registered: 2004-09-29
Posts: 1828
Loc: Belgium
|
Are you using KiXtart 4.53?Break On
Dim $
@KIX
Get $
|
Top
|
|
|
|
#180721 - 2007-09-19 11:13 AM
Re: Problem with ReadFileTail Function
[Re: Jochen]
|
ddady
Getting the hang of it
Registered: 2006-09-03
Posts: 98
|
Thanx JOCHEN,
You just had to say "@crlf". :-)
I have managed to do it.
|
Top
|
|
|
|
Moderator: Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart
|
0 registered
and 557 anonymous users online.
|
|
|