-
-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Writing iwd dependencies to .txt #1
Comments
It seems like the issue might be related to the regular expression not matching the expected pattern in the output of the command. Let's take a closer look at the regular expression and the output to troubleshoot the problem. The regular expression used in your code is: var reg = new Regex(@"(\([a-z]+ [0-9]\)) (.*)"); This regex is meant to match lines that have a format like "([a-z] [0-9]) asset_name". Make sure that the output you're trying to parse matches this pattern exactly. If the pattern in the output is different, the regex won't be able to capture the asset names correctly. To troubleshoot:
Here's an example of how you can add debugging statements to your code to help diagnose the issue: // ... (previous code)
if (result == 0)
{
// Add this line to debug the captured output
cli.WriteLine($"Captured Output:\n{output}");
var dumpFile = $"{zoneName}_iwd.txt";
using (FileStream fs = new FileStream(dumpFile, FileMode.Create))
{
using (StreamWriter sw = new StreamWriter(fs))
{
var reg = new Regex(@"(\([a-z]+ [0-9]\)) (.*)");
var matches = reg.Matches(output);
foreach (Match match in matches)
{
// ... (remaining code)
}
}
}
// ... (remaining code)
}
else
{
// ... (remaining code)
} By examining the captured output and potentially adjusting the regular expression pattern, you should be able to resolve the issue of the blank .txt file being generated. |
When using the command 'iwdfiles mp_terminal'
Output:
"Successfully wrote all referenced iwd-files in mp_terminal_iwd.txt"
The output text file is unfortunately blank, I have fully processed the 'update' command.
The text was updated successfully, but these errors were encountered: