I have a large file, and I took that file and divided it into 2 groups: A and B. Below is a sample of each line in the file:
5/21/2015 11:55:56 PM | Batch 6|386/767|50.33 %|CH2M-R|Processed NXRMN5...Checking refundable and non-refundable fares. Traditional Booking. Inside ticketing window. Minimum Savings Required: $131.00. Actual Savings: $257.18. Savings found: $257.18 (11.55 %). Savings were previously found.
In a nutshell, I want am writing a program that will look into both groups A and B, and if a line has "Savings found:" it will write out that line. Also if that file has a saving of 30% or greater, it will write out that line and put 1 asterisk in front, and if it has savings of 30% or greater and $500 or greater, it will write out 2 asterisks. For clarification, the 257.18 is the amount of savings that was found, and the percent next to that number is the percentage that has to be found.
This is the if statement that I have so far, I just need the code that has to go inside the if statement:
if (a.Any(item => item.Contains("Savings found:"))
{
}
I am new to c# and I have no idea how to make the console write the specific line of code that has these requirements. Any help will be appreciative!
Aucun commentaire:
Enregistrer un commentaire