Hello Team,
I am not sure where to start from. I have a log file which will have multiple table entries shown as below.
Table Name : AA
MAX(ADD_DTM) MAX(MNT_DTM)
11-MAR-17 11-MAR-17
Table Name : ENTPRS_RSCTN
ENTPRS_RSCTN_COUNT
34113
I need to search for Table name : AA. Once table AA is found, i need to check the column MAX(ADD_DTM) and store its value in a variable. similiarly, i need to store the value of MAX(MNT_DTM). How can i achieive this?
I will have multiple name tables. Once anyone shows how it has to be done for 1 table, i iwll replicate ofr other tables.
Because it does not look like a standard format like csv you will have to parse it by yourself. The following video might help you to pick the proper way for this task: Sophisitcated Techniques of Plain Text Parsing
OK, it might be an Oracle standard and if you find a module specialized for parsing Oracle spool file format it would make your life much easier but as long as it is not an industry standard like csv you will have to create something by yourself. You could try to find something in the Powershell Gallery or Microsoft Technet Script Center and adapt it to your needs.
I replied to a different question a few months ago. It had an example. Not sure if you can look for that on this site or not. I think the right solution for you would be the PowerShell 5 command ConvertFrom-String
There is a lot of information out there, I found this one to be the best. You must read this carefully and follow all of the steps using that here-string. hint: @“”@ don’t forget the second @
Wow … sorry if that sounds ungrateful or too critical but IMHO what you just did is just wrong and unnecessary. Not your code - probably it’s good, I didn’t test it but do you really think that’s the best way to help the original poster when you do his job? Why do you do something like this? You don’t have to prove anything to no one.
Hi Sam,
Everything worked as expected. I want to send the output displayed on the screen in an email.I used “out-string” and captured the output in a variable but the output is not elegant. How can i format the output and present it in an email. I do not want to send it as an attachment
Thanks for your help.