Get lines starting with a specific word and export it in csv

Hello,
I have a text file of an application that sometimes goes in error.
When the error occurs we have something like that:
12/08/2013 21:36:15 - ERREUR     12/08/2013 21:36:15 - erreur open connexion : -2147467259 !! [IBM][CLI Driver] SQL30081N  Erreur de communication détectée.  Protocole : "TCP/IP".  API de communication
utilisée : "SOCKETS".  Emplacement dans lequel l'erreur a été détectée : "192.168.1.15".  Fonction de communication détectant l'erreur : "selectForConnectTimeout".  Codes d'erreur spécifiques du protocole : "0",
"*", "*".  SQLSTATE=08001
12/08/2013 21:36:15 -  Machine : testVm
12/08/2013 21:36:15 - ERREUR     12/08/2013 21:36:15 - erreur select repertoire : 3704 !! Cette opération n'est pas autorisée si l'objet est fermé. !! SELECT  distinct rep_inter, rep_transfert From exploit.rep WHERE  
type_rep = 'E'   and machine = 'testvm' ORDER BY rep_inter,rep_transfert;
12/08/2013 21:36:15 - ERR     12/08/2013 21:36:15 pb trait_repertoire
12/08/2013 21:36:15 - Fin de session
Yes, the message is in French :)
That I need, is to read the file and search the ERREUR and then, include the message until the "Fin de session"
(including the date and the hour that the error occurred).
I tried this command: get-content .\error_Log.txt |Select-String "ERR" -SimpleMatch |
export-csv .\ERREURS-$(Get-Date -Format dd-MMMM-yyyy-HH-mm-ss).csv
But it is catastrophic!!!
The output that i'd like to have is:
DATE - HOUR - message error in three collumns of a CSV file.
Note: In the middle of the message there is a BLANK line, it is normal.
Any ideas will be welcome.
thank you in advance.

Hi,
thanks for answering....your script does partially that I need.
I explain: The output is in three columns but the error message is truncated, that is to say, I don't have the message entirely. To explain you, in the example above, when I generate the CSV file, the part ""192.168.1.15".  Fonction de communication
détectant l'erreur : "selectForConnectTimeout".  Codes d'erreur spécifiques du protocole : "0", "*", "*".  SQLSTATE=08001"
is missing...it goes directly to the line "12/08/2013 21:36:15 - ERREUR     12/08/2013 21:36:15 - erreur select repertoire : 3704 !!".
Also that I need is to remove the double date-hour that appears in the same line.
Thanks once again!

Similar Messages

  • Property List error: Unexpected character b at line 1 / JSON error: JSON text did not start with array or object and option to allow fragments not set.

    Hi,
    I have a MBP 13' Late 2011 and Yosemite 10.10.2 (14C1514).
    Until yesterday, I was using Garmin ConnectIQ SDK and all was working fine.
    Yesterday, I've updated my system with latest security updates and Xcode updates too (Version 6.2 (6C131e)).
    Since, I can't launch the ConnectIQ simulator app, I have this message in console :
    8/04/2015 15:19:04,103 mds[38]: There was an error parsing the Info.plist for the bundle at URL Info.plist -- file:///Volumes/Leto/connectiq-sdk-mac-1.1.0_2/ios/ConnectIQ.bundle/
    The data couldn’t be read because it isn’t in the correct format.
    <CFBasicHash 0x7fa64f44e9a0 [0x7fff7dfc7cf0]>{type = immutable dict, count = 2,
    entries =>
      0 : <CFString 0x7fff7df92580 [0x7fff7dfc7cf0]>{contents = "NSDebugDescription"} = <CFString 0x7fa64f44f0a0 [0x7fff7dfc7cf0]>{contents = "Unexpected character b at line 1"}
      1 : <CFString 0x7fff7df9f5e0 [0x7fff7dfc7cf0]>{contents = "kCFPropertyListOldStyleParsingError"} = Error Domain=NSCocoaErrorDomain Code=3840 "The data couldn’t be read because it isn’t in the correct format." (Conversion of string failed.) UserInfo=0x7fa64f44eda0 {NSDebugDescription=Conversion of string failed.}
    I have looked at this file and it looks like a binary plist
    bplist00ß^P^V^A^B^C^D^E^F^G^H
    ^K^L^M^N^O^P^Q^R^S^T^U^V^W^X^Y^Z^[^\^]^^^_ !"$%&'()'+,^[\CFBundleNameWDTXcodeYDTSDKName_^P^XNSHumanReadableCopyrightZDTSDKBuild_^P^YCFBundleDevelopmentRegion_^P^OCFBundleVersi    on_^P^SBuildMachineOSBuild^DTPlatformName_^P^SCFBundlePackageType_^P^ZCFBundleShortVersionString_^P^ZCFBundleSupportedPlatforms_^P^]CFBundleInfoDictionaryVersion_^P^RCFBundleE    xecutableZDTCompiler_^P^PMinimumOSVersion_^P^RCFBundleIdentifier^UIDeviceFamily_^P^QDTPlatformVersion\DTXcodeBuild_^P^QCFBundleSignature_^P^ODTPlatformBuildYConnectIQT0611[iph    oneos8.1o^P-^@C^@o^@p^@y^@r^@i^@g^@h^@t^@ ^@©^@ ^@2^@0^@1^@5^@ ^@G^@a^@r^@m^@i^@n^@.^@ ^@A^@l^@l^@ ^@r^@i^@g^@h^@t^@s^@ ^@r^@e^@s^@e^@r^@v^@e^@d^@.V12B411RenQ1V14C109Xiphoneos    TBNDLS1.0¡#XiPhoneOSS6.0YConnectIQ_^P"com.apple.compilers.llvm.clang.1_0S8.1_^P^Tcom.garmin.ConnectIQ¡*^P^AW6A2008aT????^@^H^@7^@D^@L^@V^@q^@|^@<98>^@ª^@À^@Ï^@å^A^B^A^_^A?^AT^    A_^Ar^A<87>^A<96>^Aª^A·^AË^AÝ^Aç^Aì^Aø^BU^B\^B_^Ba^Bh^Bq^Bv^Bz^B|^B<85>^B<89>^B<93>^B¸^B¼^BÓ^BÕ^B×^Bß^@^@^@^@^@^@^B^A^@^@^@^@^@^@^@-^@^@^@^@^@^@^@^@^@^@^@^@^@^@^Bä
    I guess it is a normal format but my system seems to be unable to read binary plist ?
    I tried some stuff with plutil
    plutil -lint Info.plist
    Info.plist: Unexpected character b at line 1
    Same for convert
    plutil -convert xml1 Info.plist
    Info.plist: Property List error: Unexpected character b at line 1 / JSON error: JSON text did not start with array or object and option to allow fragments not set.
    I also try to download a fresh version of the connectIQ SDK and no changes.
    Any idea ?
    Thanks

    Step by step, how did you arrive at seeing this agreement?

  • HT1533 My MacBook has crashed...it started with capitals letters sticking and always starting in safe mode and now despite efforts to restore from my Lacie externall drive I can't get anything on screen except a grey "stop" sign

    My MacBook has crashed...it started with capitals letters sticking and always starting in safe mode and now despite efforts to restore from my Lacie externall drive I can't get anything on screen except a grey "stop" sign

    Sorry just noticed I've probably posted this under the wrong forum header

  • Creating a template in Pages is straight-forward as answered here previously. Is there and equivalent for iBooks Author which can start with a blank page and build up the template as required? or can one only adapt a ready made template?

    Creating a template in Pages is straight-forward as answered here previously. Is there an equivalent for iBooks Author which can start with a blank page and build up the template as required? or can one only adapt a ready made template? This has proved unsatisfactory to me so far. Lines are left in etc.

    There are two basic menus for fonts - one from the main menu bar and one from the toolbar. You can also bring up the font manage dialog.
    I don't recommend trying to hard to force an otherwise foreign font, as it inevitably needs to be usable/supported on iOS as well, and that can get tricky w/3rd party fonts, as an example, even with the expanded font support in the latest iBA.
    If you need to discuss fonts more, I suggest starting a new thread....preferably with a slightly more brief title, thanks.

  • Need help to find GPOs with a specific word

    Hi Experts,<o:p></o:p>
    In my environment, we have 500+ GPOs and I have been asked to find the GPOs with a specific word like "dns". I believe powershell is the better way to find my requirement and I
    am in KG standard in Powersell :(<o:p></o:p>
    Thanks
    Sajoor

    Get-GPO (From the GroupPolicy module) doesn't allow for wildcards in the -Name parameter, so the best you can do with that cmdlet is something like this:
    Get-Gpo -All | Where {
    $_.DisplayName -match 'dns'
    Boe Prox
    Blog |
    Twitter
    PoshWSUS |
    PoshPAIG | PoshChat |
    PoshEventUI
    PowerShell Deep Dives Book

  • Has anyone tried creating a plugin that you can type in a specific word, and if it comes up in the very top of the page (i think its refered to as the header) it closes the page or tab automatically?

    Has anyone tried creating a plugin that you can type in a specific word, and if it comes up in the very top of the page (i think its refered to as the header) it closes the page or tab automatically? there is a program called POW! by AnalogX that does this, but its only good for IE. And Im a Firefox man. Can anyone look into this or maybe create a plugin that does what POW! does for IE? I will donate to the creater of a plugin that does that. Im so sick of pop ups that most pop up blockers miss.

    The Firefox pop-up blocker is very effective. If you are getting a lot of pop-ups in Firefox, you may have picked up some Malware that is causing those pop-ups.
    Install, update, and run these programs in this order. '''''(Not all programs detect the same Malware.)''''' They are all free for personal use, but some have limited functionality in the "free mode" - but those are features you really don't need to find and remove the problem that you have.<br />
    ''Note: If your Malware infection is bad enough and you are mis-directed to URL's other than what is posted, you may have to use a different PC to download these programs and use a USB stick to transfer them to the afflicted PC.''
    Malwarebytes' Anti-Malware - [http://www.malwarebytes.org/mbam.php] <br />
    SuperAntispyware - [http://www.superantispyware.com/] <br />
    AdAware - [http://www.lavasoftusa.com/software/adaware/] <br />
    Spybot Search & Destroy - [http://www.safer-networking.org/en/index.html] <br />
    Windows Defender: Home Page - [http://www.microsoft.com/windows/products/winfamily/defender/default.mspx]
    If these don't find it or can't clear it, post in one of these forums for specialized malware removal help: <br />
    [http://www.spywarewarrior.com/index.php] <br />
    [http://forum.aumha.org/] <br />
    [http://www.spywareinfoforum.com/] <br />
    [http://bleepingcomputer.com]

  • New session started with an advertizing page and all my tabs are lost

    New session started with an advertizing page and all my tabs are lost. Restore the previous session is not active. How can I restore my tabs?

    This advice might come too late, but, don't exit Firefox! Or if you already did, don't start it back up again!
    ''If Firefox is running:'' Open your current Firefox settings (AKA Firefox profile) folder using either
    * "3-bar" menu button > "?" button > Troubleshooting Information
    * (menu bar) Help > Troubleshooting Information
    * type or paste about:support in the address bar and press Enter
    In the first table on the page, click the "Show Folder" button. This should launch a new window listed various files and folders. For best results, change the view to "Details".
    (''If Firefox not running, get to this folder by pasting the following in the Run box on the start menu and pressing Enter: %APPDATA%\Mozilla\Firefox\Profiles and then double-click into the most recently updated semi-randomly-named folder you find there.'')
    In the window that launches, scroll down and double-click into the '''sessionstore-backups''' folder. Save all files here to a safe location, such as your Documents folder, so Firefox doesn't overwrite them. We may be able to use them to recover your lost tabs.
    Also, if you return to the main level of the profile folder, you may find some sessionstore files. Copy those to the safe location as well.
    Could you report back on what you found?
    Note: If Windows hides the .js file extension from you, you can change a setting so that you can see all file extensions (this helps when renaming files). This support article has the steps: http://support.microsoft.com/kb/865219 or http://windows.microsoft.com/en-us/windows/show-hide-file-name-extensions
    The kinds of files you may find among your sessionstore-backup files are:
    * recovery.js: the windows and tabs in your currently live Firefox session (or, if Firefox is closed, your last session)
    * recovery.bak: a backup copy of recovery.js
    * previous.js: the windows and tabs in your last Firefox session
    * upgrade.js-''build_id'': the windows and tabs in the Firefox session that was live at the time of your last update

  • How can i set up mac mail so each line starts with a capital letter?

    how can i set up mac mail so each line starts with a capital letter? 

    I am pretty sure that this is not an option within Apple Mail.

  • TS1717 Trying to download iTunes onto PC installed with windows vista. Download keeps getting to 99% with 1 second remaining and then freezes / does nothing? Any help appreciated.

    Trying to download itunes onto PC installed with windows vista. Download keeps getting to 99% with 1 second remaining and then freezes / does nothing? Any help appreciated.

    I solved the problem! The updates orignally were downloaded to the C: drive of the server. I've since moved them to the E: drive and for some reason the Content folder in IIS didn't change the file path to the new WSUScontent folder.
    The root cause for this was failing to use the UTILITY designed for this very purpose.
    I edited the virtual directory settings in IIS and was able to put the correct path in.
    You still need to use the UTILITY.. to fix all the other stuff you're still missing.
    In the %ProgramFiles%\Update Services\Tools folder...
    WSUSUTIL MOVECONTENT E:\WSUS E:\WSUS\MoveContent.LOG -SKIPCOPY
    This problem was caused by moving the WSUS updates to a different local drive.
    No. This problem was caused by IMPROPERLY moving the WSUS updates to a different local drive.
    Lawrence Garvin, M.S., MCSA, MCITP:EA, MCDBA
    SolarWinds Head Geek
    Microsoft MVP - Software Packaging, Deployment & Servicing (2005-2014)
    My MVP Profile: http://mvp.microsoft.com/en-us/mvp/Lawrence%20R%20Garvin-32101
    http://www.solarwinds.com/gotmicrosoft
    The views expressed on this post are mine and do not necessarily reflect the views of SolarWinds.

  • My MacBook Pro shuts down within seconds after starting with a Gray Screen and Apple Logo, a bar comes at the bottom.

    My MacBook Pro starts with a Gray Screen and Apple Logo, a bar comes at the bottom, but after few seconds the machine shuts down. This was bought approx 1 year back. Please help!!

    jayanta.ray,
    which model MacBook Pro do you have (did you buy it new?), and which version of OS X is installed on it?

  • When I get an email with a pic in and I go to reply a box drops Dow and asks "save photo" when I click on that it "seems" like nothing happens, bot are they being automatically saved someplace, where?

    When I get an email with a pic in and I go to reply a box drops Dow and asks "save photo" when I click on that it "seems" like nothing happens, bot are they being automatically saved someplace, where?

    If photos are saved they go to the Camera Roll in the Photos App.

  • I deleted gardens of time yesterday and need to get it back with the current data and progress. Is this possible?

    I deleted gardens of time yesterday and need to get it back with the current data and progress. Is this possible?

    Is that on an iPad, iPod Touch or iPhone?

  • I just bought and downloaded LION and now I get a box that says Microsoft Word and Excel cannot open because PowerPC Apps are no longer supported.

    I just bought and downloaded LION and now I get a box that says Microsoft Word and Excel can not open because PowerPC Apps are no longer supported. How can I reactivate Word and Excel.

    You need to upgrade to Office 2008 or newer, or switch to a product such as OpenOffice or iWork.
    (61340)

  • I'm a meeting organizer and I'm using office 365Outlook. When an attendee invited to a meeting tentatively accept proposing a new time for the meeting, I get a message with "New Time Proposed" and, when I open it, the "Accept" or declined or propose new t

    I'm a meeting organizer and I'm using office 365Outlook. When an attendee invited to a meeting tentatively accept proposing a new time for the meeting, I get a message with "New Time Proposed" and, when I open it, the "Accept" or declined
    or propose new time button is grayed out so that I cannot accept the new time. When this occurs, I must create a new meeting request with the new time that has been proposed.

    Use the trackpad to scroll, thats what it was designed for. The scroll bars automatically disappear when not being used and will appear if you scroll up or down using the trackpad.
    This is a user-to-user forum and most people will post on here if they have problems. You very rarely get people posting to say there update went smooth. The fact is the vast majority of Mountain Lion users will not be experiencing any major problems with the OS, or maybe with apps which are not compatible, but thats hardly Apple's fault if developers don't update their apps.

  • TS4006 My phone will not turn on, therefore I have received a replacement phone but am wanting to reset my old device. It is not locating it because it says it is offline however I cannot turn it on at all. Can I start with my new device and not reset the

    My phone will not turn on, therefore I have received a replacement phone but am wanting to reset my old device. It is not locating it because it says it is offline however I cannot turn it on at all. Can I start with my new device and not reset the old? Any help would be greatly appreciated. It's been a week without a phone

    That does happen.  It depends on how hard the server is being hit, as well as the connection speed of your system.  If you are on a windows system, you will want to disable any antivirus or firewall software during the download.

Maybe you are looking for

  • Change of cost in Sales Order

    Is it possible to make the change in the VPRS value in a sales order? Thanks, ak

  • How can I import photos to my ipad from someone else's imac?

    I have a mobile me account and can get to it with browser. I am on someone else's computer and have some pictures in their iPhoto that I want to move to my iPad. Is there some way to get them there when I do not have access to my iMac? Can I somehow

  • Insert  Line item in Po

    Hi Guru's, I need to insert new line item into po if the material entered is BOM material , my requirment like this , if the user creates the po with BOM material then i need insert all the inside components as line item in that po, please suggest me

  • Change of sender of gmail

    I am a user of several e-mail addresses as a sender in my Gmail account. I cannot use my other sender addresses than default gmail address ("@gmail.com" address). Do you know if I can use the other addresses as a sender and how to set up. Thanks. Cur

  • Suggested alternative to key mapping?

    Hello! I started using Abelton live for putting together easily accessible virtual instruments for live performance. For example, if my band performs the entire Dark Side of the Moon album, I can create each song in order of the album with the necess