Hello Users,
I have attached 1 log files in which a line needs to be validated. Position of this validation point may differ and please find the below validation strings
Need to get values before and after ' RunPackage.exe Version: '
Need to get values after Host Name: or OS Version
08/10/2017 21:24:06 :: Exiting with Error Code: 0
Product Name: Adobe Acrobat Reader DC MUI. Product Version: 17.009.20044. Product Language: 1033. Manufacturer: Adobe Systems Incorporated. Reconfiguration success or error status: 0.
I have worked already with some regular expression get values but not succeed.
Please help me out from this.
Thanks,
Sai
Read values from Notepad
Read values from Notepad
- Attachments
-
InstallLog.log
- (23.85 KiB) Downloaded 44 times
Re: Read values from Notepad
Hi,
In my opinion, it's pointless to read the lines from notepad. I would suggest to load entire file into memory (using I/O methods) and process the file using a combination of string manipulation methods and regexes. I'm currently out of computer, but I'm sure you can find many relevant code samples via google.
In my opinion, it's pointless to read the lines from notepad. I would suggest to load entire file into memory (using I/O methods) and process the file using a combination of string manipulation methods and regexes. I'm currently out of computer, but I'm sure you can find many relevant code samples via google.
Pavel Kudrys
Ranorex explorer at Descartes Systems
Please add these details to your questions:
Ranorex explorer at Descartes Systems
Please add these details to your questions:
- Ranorex Snapshot. Learn how to create one >here<
- Ranorex xPath of problematic element(s)
- Ranorex version
- OS version
- HW configuration
Re: Read values from Notepad
Thank you for your reply.
I have scenario that need to read some values from log files (Notepad) after installation of some files.
The above log file contains large data so Ranorex is reading some data from log file, not all data.
Is there any configurations/settings to read all the data in log files?
And plaese share us some related RE for above scenarios?
Thanks,
Sai
I have scenario that need to read some values from log files (Notepad) after installation of some files.
The above log file contains large data so Ranorex is reading some data from log file, not all data.
Is there any configurations/settings to read all the data in log files?
And plaese share us some related RE for above scenarios?
Thanks,
Sai
Re: Read values from Notepad
Hello Users/Ranorex Team,
Please support for above.
Thanks in Advance
Sai
Please support for above.
Thanks in Advance
Sai
Re: Read values from Notepad
This is not really a Ranorex issue, but more of a standard .NET issue. You will need to use the .NET IO library and read from the file directly.
Your best bet would be to google ".NET read file".
From that point you need to compare what you read to what you expect.
Your best bet would be to google ".NET read file".
From that point you need to compare what you read to what you expect.
Shortcuts usually aren't...
Re: Read values from Notepad
Thank you for support.
yes, this is not really a Ranorex issue, i have followed documentaion at https://www.ranorex.com/help/latest/code-examples and i am able search for particular text without using RE like below
string file_installLog = @"../../Notepad/installLog.log";
// Read text line by line from file
string[] installLog = System.IO.File.ReadAllLines(file_installLog);
foreach (string line in installLog)
{
// Report.Info("",line); // print all line
if(line.Contains("Exiting with Error Code"))
{
Report.Info("",line);
Report.Success("Text is found");
}
}
Sai
yes, this is not really a Ranorex issue, i have followed documentaion at https://www.ranorex.com/help/latest/code-examples and i am able search for particular text without using RE like below
string file_installLog = @"../../Notepad/installLog.log";
// Read text line by line from file
string[] installLog = System.IO.File.ReadAllLines(file_installLog);
foreach (string line in installLog)
{
// Report.Info("",line); // print all line
if(line.Contains("Exiting with Error Code"))
{
Report.Info("",line);
Report.Success("Text is found");
}
}
Sai