Hello,
I am looking for VBA code that will allow me to:
1) Import a .log file into excel.
2) Look for key words in a line of text.a) The lines of text I am interested in will all have the pattern: X purchases the Y for Z dollars of his allowance.
3) If the key words are in a line of text, extract the number within that same line of text.
4) Create a category for the subject of that line of text.
5) Add the number within the line of text to two separate cells:a) To one cell that tracks the total spent for the subject of that line of text.
b) To one cell that keeps a running total for the entire document.
Example of a typical .log file is as follows:
The store opened on Tuesday afternoon.
Dexter purchases the Vase for 8 dollars of his allowance.
Ralph purchases the Vase for 7 dollars of his allowance.
The store closed on Sunday morning.
The store opened on Monday evening.
Carl purchases the Vase for 6 dollars of his allowance.
Jim purchases the Vase for 8 dollars of his allowance.
Ralph purchases the Vase for 10 dollars of his allowance.
The store closed on Wednesday afternoon.
The store opened on Thursday evening.
Ralph purchased the Vase for 11 dollars of his allowance.
Carl purchases the Vase for 7 dollars of his allowance.
I would need Categories that show the following data from the text above:
Dexter = 8
Ralph = 28
Carl = 13
Jim = 8
Total store profit = 57
Thanks in advance
Bookmarks