readfile with variable?

Technical support and scripting issues

Moderators: JRL, Dorian (MJT support)

Post Reply
buckw1
Junior Coder
Posts: 20
Joined: Sun Sep 18, 2005 5:08 am

readfile with variable?

Post by buckw1 » Mon Sep 19, 2005 2:02 am

Hi,
Am trying to read log files and then combine them into one.
I can identify them, grab the names and read ONE file and there I'm stuck..how do I read the contents of log1 and then read log 2 and combine with log1 into log_file?

Using this:

let>log_line=8
run>cmd /c dir C:\Progra~1\CCP\Eve\capture\Gamelogs\ /o-d>c:\evelogfiles.txt
label>read_log_start
let>path=C:\Progra~1\CCP\Eve\capture\Gamelogs\
// get name of latest log
readln>c:\evelogfiles.txt,%log_line%,latestlog%log_line%
//readln>c:\evelogfiles.txt,9,2ndlatestlog
// Get actual file name //
let>file_name={"file_name"+%log_line%}
Midstr>latestlog%log_line%,40,19,file_name
// read the log //
let>path1=%path%%file_name%
readfile>path1,log_text
let>log_text_final=%log_text%+1
message>log_text_final
let>log_line=%log_line%+1
if>log_lineend

User avatar
Bob Hansen
Automation Wizard
Posts: 2475
Joined: Tue Sep 24, 2002 3:47 am
Location: Salem, New Hampshire, US
Contact:

Post by Bob Hansen » Mon Sep 19, 2005 2:56 am

You can use Macro Scheduler Appendfile> command:
AppendFile>c:\temp\file1.txt,c:\temp\file2.txt,c:\temp\newfile.txt,result

======================
You can also use COPY command to append files:

COPY file1.txt + file2.txt + file3.txt file4.txt

This will result in file4.txt which will be files1,2,3.txt appended as one file.

This can be done in Macro Scheduler with
Run Program> cmd /c COPY file1.txt + file2.txt + file3.txt file4.txt
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!

buckw1
Junior Coder
Posts: 20
Joined: Sun Sep 18, 2005 5:08 am

Post by buckw1 » Mon Sep 19, 2005 8:58 pm

Append works great, somehow missed that command....

Thank you,

Don

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts