Reading log file and calculating time between

If someone could help me with this one, I would be very grateful.
I have a log file and I need to search a string that contains a start time and end time (eg. <time="11:10:58.000+000">). When I have these two values, I need to measure the time that has been elapsed between these two (from start to end).

$Path="C:\Times.log"
remove-item $Path
Add-Content $Path '<time="11:10:58.000+000">'
Add-Content $Path '<time="12:10:58.000+000">'
Add-Content $Path '<time="13:10:58.000+000">'
Add-Content $Path '<time="15:13:38.000+000">'
Add-Content $Path '<time="16:10:58.000+000">'
Add-Content $Path '<time="17:08:28.000+000">'
$File=Get-Content $Path
$StartTime=$Null
$EndTime=$Null
$ElapsedTime = $Null
ForEach ($Line in $File)
If ($Line.Contains("time="))
$Position = $Line.IndexOf("time=")
$TimeStr =$Line.SubString($Position+6,8)
IF ($StartTime -EQ $Null)
$StartTime = $TimeStr -As [System.TimeSpan]
Else
$EndTime = $TimeStr -As [System.TimeSpan]
$ElapsedTime = $EndTime.Subtract($StartTime)
"StartTime=$StartTime EndTime=$EndTime ElapsedTime=$ElapsedTime"
$StartTime = $Null
Gives this output
StartTime=11:10:58 EndTime=12:10:58 ElapsedTime=01:00:00
StartTime=13:10:58 EndTime=15:13:38 ElapsedTime=02:02:40
StartTime=16:10:58 EndTime=17:08:28 ElapsedTime=00:57:30

Similar Messages

  • Why does my quicktime player verson 10.2 somtimes read avi files and other times it wont recognize them?

      Why does my quicktime player version 10.2 sometimes read AVI video and other times it will not recognize that same file. I have a video card that sometimes it will read then the next time it recognizes the card but will not open the video. Message says "quicktime does not recognize this file.
    Whats up with that ??? Any help will be most appreciated!

    AVI is a container just like MKV, WMV, MOV, and MPEG. It is possible to use many different compression formats aka. codecs in an AVI container.
    Think of the container - AVI as being an envelope, and the compressed video in it as a letter. The letter may be in a language you cannot read even though you know how to open the envelope.
    Historically QuickTime did have some built-in ability to use AVI files and some formats in those files, this used to be further improved by installing the free Perian (for Mac only). However with Mavericks Apple have removed the ability for QuickTime X aka. QuickTime Player 10 to use AVI files, it now really only accepts MPEG4 or H.264.
    It is still possible to install QuickTime 7.6.6 in Mavericks and if you use it and Perian rather than QuickTime X you can still use various AVI files.
    Note: Mavericks also now no longer shows previews or thumbnails for AVI files for the same reason.

  • Diff between Log files and Trace files

    hi
    What is the exact differences between Log Files and Trace Files.
    And the relevant informative URL/reference materils would be highly appriciated.
    Thanks
    Sekhar

    Hi,
    Go through these,
    http://help.sap.com/saphelp_nw04/helpdata/en/d1/7b1e40777cdd5fe10000000a155106/frameset.htm
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/0bf8c890-0201-0010-8b8c-fc93fa1f4795
    Hope it clarifies
    Regards
    Srinivasan T

  • Why can't read access log file in real-time? (Oracle Weblogic Server 10.3)

    We can't read access log file in real-time. If access log is rotation to new file so can read access log file but can't read real-time.
    *** Oracle Weblogic Server versions 10 R3

    what's your meaning? try this command "tail -f access.log".
    Threre is a buffer about 8K for WebLogic to write the access info into the log files, so you can't see the access info untill the buffer is full.

  • Show RMAN  message in log file and screen at same time

    Is there any way I can save all RMAN message in a log file and also show on standar out (screen).
    Thanks

    Hi,
    You can try a shell script like this if you are using linux:
    #!/bin/sh
    # Name: test_backup
    # Author: Tad_cs
    # Description: Executes backup using the RMAN
    export ORACLE_HOME=$1
    export ORACLE_SID=$2
    export LOG_DIR=$3
    # Variables:
    SCRIPT="test_backup"
    data_log=`date '+%y-%m-%d_%H:%M:%S'`
    logfile=${LOG_DIR}/${SCRIPT}-${data_log}.log
    # Execution of script backup of rman:
    $ORACLE_HOME/bin/rman <<EOF > $logfile
    connect target rman/rman
    connect catalog rman/rman
    run { execute script test_backup; }
    EOF
    exitSo, While the script is performing, you can open other screen, search for
    the log that is generating, and see the contents using:
    tail -f log_file_name.logIs this you need?
    []´s

  • Where are adobe reader log files?

    Where are the log files for Adobe Reader?
    When one of our clients opens a form off our liquid office server we receive an error.  If possible I would like to find a log file that might give some sort of clue as to why this is happening.  Thanks

    I'll make an inquiry about that and if we have to contact liquid office at some point my guess is they may request that we do that if there is likely to be any useful information there.  It is likely going to be pretty difficult as we have lots of clients opening forms constantly throughout the day.
    I did find adobearm log file and also adobereaerbroker log file in the temp files on my own.  So it does seem like reader logs some of it's activities.  I haven't examined them completely yet but a quick comparison between a working machine opening our problem form and the one the computer that doesn't open it properly seems to show no obvious differences.  They both seem to show problems with access denied and registry entries.  However one works and the other doesn't even with the same issues in the log.

  • Reading one file at a time using File Adapter

    I am using a File Adapter which polls every minute to read files from a Folder. This process picks up all the files in that folder. What I want to achieve is that the File Adapter should read one file at a time. Is it possible to force it to wait for a few seconds before reading the Next file in the Folder. Or is there a solution to what I am trying to achieve? Any help would be appreciated.

    public static char readChar() {
    int ch;
    char r = '\0';
    boolean done = false;
    while (!done) {
    try {
    ch = System.in.read();
    r = (char) ch;
    if (r == '\r') {
    System.out.println("Not a character. Please try again!");
    System.in.skip(1);
    done = false;
    } else {
    System.in.skip(2);
    done = true;
    } catch (java.io.IOException e) {
    done = true;
    return r;
    Try this as an method and then use it..
    This code will read will be in response untill you hit the return key but will take only the first character....

  • The hard drive on my MacBook died and I had it replaced. I can't locate my website files and every time I try to open my idisk it looks for a name and password (even reset my apple id as prompted) I keep being told that it's the wrong name or password?

    The hard drive on my MacBook died and I had it replaced. Now I can't locate my website files and every time I try to open my finder/idisk it looks for a name and password (even reset my apple id as prompted) I keep being told that it's the wrong name or password? Any suggestions out there

    Arty ~ Welcome to the Support Communities. iWeb can't import/open published HTML/media files on your iDisk. iWeb can only open its key Domain file which contains your site data — it's usually located here:
    ...If you don't have a backup of your Domain file (e.g. via Time Machine), paragraph 2.3 of this FAQ page gives some tips on how to use published files, graphics, photos, etc., to help rebuild the site from scratch:
    http://iwebfaq.org/site/iWeb_Backup_retrieve.html
    Also this thread may help:
    Hard Drive replacement causes new/unknown user password?

  • Reading text file and output (to stdout) a list of the unique words in the

    Hi,
    I have a main method as
    main.java
    package se.tmp;
    public class Main
    public static void main( String[] args )
    WordAnalyzer.parse( args[0] );
    and text file as
    words.txt
    the quick brown fox jumps over the lazy dog
    the quick brown fox jumps over the lazy dog
    the quick brown fox jumps over the lazy dog
    the quick brown fox jumps over the lazy dog
    the quick brown fox jumps over the lazy dog
    the quick brown fox jumps over the lazy dog
    the quick brown fox jumps over the lazy dog
    the quick brown fox jumps over the lazy dog
    the quick brown fox jumps over the lazy dog
    the quick brown fox jumps over the lazy dog
    the quick brown fox jumps over the lazy dog
    the requirement is like
    I need create this WordAnalyzer class, implement the parse method, and then commit the file. This method takes a single parameter, the filename of the file to parse. The method should read this file and output (to stdout) a list of the unique words in the file along with the number of times each appears in the file.
    Can anyone please help me on this?
    Thanks.

    Where are you having problems?

  • How to read .html file and store values into oracle table  from html file

    Hi all ,
    How to read .html file and store values into oracle table from html file using pl/sql
    Please Help.....

    Hi,
    Kindly find following sample html code ,i want to store every value in different column in database .
    <html><body><p/>
    <div style="position:absolute;top:47px;left:37px;font-family:'Times New Roman';font-size:10pt;white-space:nowrap;"> 
    </div>
    <div style="position:absolute;top:47px;left:680px;font-family:'Times New Roman';font-size:10pt;white-space:nowrap;">  
    </div>
    <div style="position:absolute;top:94px;left:151px;font-family:'Times New Roman';font-size:1pt;white-space:nowrap;"> 
    </div>
    <div style="position:absolute;top:1080px;left:115px;font-family:'Times New Roman';font-size:8pt;white-space:nowrap;">4497743
    </div>
    <div style="position:absolute;top:1079px;left:442px;font-family:'Times New Roman';font-size:9pt;white-space:nowrap;"> Miclyn Express Offshore Pre-Quotation Disclosure
    </div>
    <div style="position:absolute;top:1079px;left:680px;font-family:'Times New Roman';font-size:9pt;white-space:nowrap;"> 
    </div>
    <div style="position:absolute;top:1079px;left:723px;font-family:'Times New Roman';font-size:9pt;white-space:nowrap;">page 5
    </div>
    <div style="position:absolute;top:1083px;left:151px;font-family:'Times New Roman';font-size:1pt;white-space:nowrap;"> 
    </div>
    <div style="position:absolute;top:107px;left:151px;font-family:'Times New Roman';font-size:10pt;white-space:nowrap;"><b>Attachment 2 ¿ indicative statement of 20 largest shareholders </b>
    </div>
    <div style="position:absolute;top:139px;left:262px;font-family:'Times New Roman';font-size:10pt;white-space:nowrap;"><b>Name </b>
    </div>
    <div style="position:absolute;top:131px;left:415px;font-family:'Times New Roman';font-size:10pt;white-space:nowrap;"><b>Number of Shares </b>
    </div>
    <div style="position:absolute;top:147px;left:458px;font-family:'Times New Roman';font-size:10pt;white-space:nowrap;"><b>Held </b>
    </div>
    <div style="position:absolute;top:131px;left:560px;font-family:'Times New Roman';font-size:10pt;white-space:nowrap;"><b>Percentage of </b>
    </div>
    <div style="position:absolute;top:147px;left:567px;font-family:'Times New Roman';font-size:10pt;white-space:nowrap;"><b>shares held </b>
    </div>
    <div style="position:absolute;top:179px;left:161px;font-family:'Times New Roman';font-size:11pt;white-space:nowrap;">Macquarie Capital Group Limited 92,378,000
    </div>
    <div style="position:absolute;top:179px;left:531px;font-family:'Times New Roman';font-size:11pt;white-space:nowrap;"> 
    </div>
    <div style="position:absolute;top:179px;left:618px;font-family:'Times New Roman';font-size:11pt;white-space:nowrap;">34.00%r
    </div>
    <div style="position:absolute;top:179px;left:663px;font-family:'Times New Roman';font-size:11pt;white-space:nowrap;"> 
    </div>
    <div style="position:absolute;top:212px;left:161px;font-family:'Times New Roman';font-size:11pt;white-space:nowrap;">HSBC Custody Nominees (Australia)
    </div>
    <div style="position:absolute;top:227px;left:161px;font-family:'Times New Roman';font-size:11pt;white-space:nowrap;">Limited
    </div>
    <div style="position:absolute;top:220px;left:464px;font-family:'Times New Roman';font-size:11pt;white-space:nowrap;">36,458,220
    </div>
    <div style="position:absolute;top:220px;left:531px;font-family:'Times New Roman';font-size:11pt;white-space:nowrap;"> 
    </div>
    <div style="position:absolute;top:220px;left:618px;font-family:'Times New Roman';font-size:11pt;white-space:nowrap;">13.42%
    </div>
    <div style="position:absolute;top:220px;left:663px;font-family:'Times New Roman';font-size:11pt;white-space:nowrap;"> 
    </div>
    <div style="position:absolute;top:260px;left:161px;font-family:'Times New Roman';font-size:11pt;white-space:nowrap;">Ray Rider Limited 27,170,000
    </div>
    <div style="position:absolute;top:260px;left:531px;font-family:'Times New Roman';font-size:11pt;white-space:nowrap;"> 
    </div>
    <div style="position:absolute;top:260px;left:618px;font-family:'Times New Roman';font-size:11pt;white-space:nowrap;">10.00%
    </div>
    <div style="position:absolute;top:260px;left:663px;font-family:'Times New Roman';font-size:11pt;white-space:nowrap;"> 
    </div>
    <div style="position:absolute;top:300px;left:531px;font-family:'Times New Roman';font-size:11pt;white-space:nowrap;"> 
    </div>
    <div style="position:absolute;top:300px;left:625px;font-family:'Times New Roman';font-size:11pt;white-space:nowrap;">7.96%
    </div>
    <div style="position:absolute;top:300px;left:663px;font-family:'Times New Roman';font-size:11pt;white-space:nowrap;"> 
    </div>
    <div style="position:absolute;top:333px;left:161px;font-family:'Times New Roman';font-size:11pt;white-space:nowrap;">National Australia Bank Custodian
    </div>
    <div style="position:absolute;top:348px;left:161px;font-family:'Times New Roman';font-size:11pt;white-space:nowrap;">Services
    </div>
    <div style="position:absolute;top:341px;left:464px;font-family:'Times New Roman';font-size:11pt;white-space:nowrap;">12,866,550
    </div>
    <div style="position:absolute;top:341px;left:531px;font-family:'Times New Roman';font-size:11pt;white-space:nowrap;"> 
    </div>
    <div style="position:absolute;top:341px;left:625px;font-family:'Times New Roman';font-size:11pt;white-space:nowrap;">4.74%
    </div>
    <div style="position:absolute;top:341px;left:663px;font-family:'Times New Roman';font-size:11pt;white-space:nowrap;"> 
    </div>
    <div style="position:absolute;top:381px;left:161px;font-family:'Times New Roman';font-size:11pt;white-space:nowrap;">Citigroup Nominees Pty Ltd 6,942,541
    </div>
    <div style="position:absolute;top:381px;left:531px;font-family:'Times New Roman';font-size:11pt;white-space:nowrap;"> 
    </div>
    <div style="position:absolute;top:381px;left:625px;font-family:'Times New Roman';font-size:11pt;white-space:nowrap;">2.56%r
    </div>
    <div style="position:absolute;top:381px;left:663px;font-family:'Times New Roman';font-size:11pt;white-space:nowrap;"> 
    </div>
    <div style="position:absolute;top:421px;left:531px;font-family:'Times New Roman';font-size:11pt;white-space:nowrap;"> 
    </div>
    <div style="position:absolute;top:421px;left:625px;font-family:'Times New Roman';font-size:11pt;white-space:nowrap;">2.14%r
    </div>
    <div style="position:absolute;top:421px;left:663px;font-family:'Times New Roman';font-size:11pt;white-space:nowrap;"> 
    </div>
    <div style="position:absolute;top:462px;left:161px;font-family:'Times New Roman';font-size:11pt;white-space:nowrap;">UBS Securities Australia Ltd 4,806,760
    </div>
    <div style="position:absolute;top:462px;left:531px;font-family:'Times New Roman';font-size:11pt;white-space:nowrap;"> 
    </div>
    <div style="position:absolute;top:462px;left:625px;font-family:'Times New Roman';font-size:11pt;white-space:nowrap;">1.77%
    </div>
    <div style="position:absolute;top:462px;left:663px;font-family:'Times New Roman';font-size:11pt;white-space:nowrap;"> 
    </div>
    <div style="position:absolute;top:494px;left:161px;font-family:'Times New Roman';font-size:11pt;white-space:nowrap;">Merrill Lynch Equities (Australia)
    </div>
    <div style="position:absolute;top:510px;left:161px;font-family:'Times New Roman';font-size:11pt;white-space:nowrap;">Limited
    </div>
    <div style="position:absolute;top:502px;left:472px;font-family:'Times New Roman';font-size:11pt;white-space:nowrap;">4,325,000
    </div>
    <div style="position:absolute;top:502px;left:531px;font-family:'Times New Roman';font-size:11pt;white-space:nowrap;"> 
    </div>
    <div style="position:absolute;top:502px;left:625px;font-family:'Times New Roman';font-size:11pt;white-space:nowrap;">1.59%
    </div>
    <div style="position:absolute;top:502px;left:663px;font-family:'Times New Roman';font-size:11pt;white-space:nowrap;"> 
    </div>
    <div style="position:absolute;top:550px;left:161px;font-family:'Times New Roman';font-size:11pt;white-space:nowrap;">Equities Ltd
    </div>
    <div style="position:absolute;top:542px;left:472px;font-family:'Times New Roman';font-size:11pt;white-space:nowrap;">4,150,000
    </div>
    <div style="position:absolute;top:542px;left:531px;font-family:'Times New Roman';font-size:11pt;white-space:nowrap;"> 
    </div>
    <div style="position:absolute;top:542px;left:625px;font-family:'Times New Roman';font-size:11pt;white-space:nowrap;">1.53%
    </div>
    <div style="position:absolute;top:542px;left:663px;font-family:'Times New Roman';font-size:11pt;white-space:nowrap;"> 
    </div>
    <div style="position:absolute;top:575px;left:161px;font-family:'Times New Roman';font-size:11pt;white-space:nowrap;">Bond Street Custodians Limited - A/C
    </div>
    <div style="position:absolute;top:590px;left:161px;font-family:'Times New Roman';font-size:11pt;white-space:nowrap;">Institutional
    </div>
    <div style="position:absolute;top:583px;left:472px;font-family:'Times New Roman';font-size:11pt;white-space:nowrap;">2,750,000
    </div>
    <div style="position:absolute;top:583px;left:531px;font-family:'Times New Roman';font-size:11pt;white-space:nowrap;"> 
    </div>
    <div style="position:absolute;top:583px;left:625px;font-family:'Times New Roman';font-size:11pt;white-space:nowrap;">1.01%
    </div>
    <div style="position:absolute;top:583px;left:663px;font-family:'Times New Roman';font-size:11pt;white-space:nowrap;"> 
    </div>
    <div style="position:absolute;top:623px;left:161px;font-family:'Times New Roman';font-size:11pt;white-space:nowrap;">Cogent Investment Operations Pty Ltd 2,599,321
    </div>
    <div style="position:absolute;top:623px;left:531px;font-family:'Times New Roman';font-size:11pt;white-space:nowrap;"> 
    </div>
    <div style="position:absolute;top:623px;left:625px;font-family:'Times New Roman';font-size:11pt;white-space:nowrap;">0.96%
    </div>
    <div style="position:absolute;top:623px;left:663px;font-family:'Times New Roman';font-size:11pt;white-space:nowrap;"> 
    </div>
    <div style="position:absolute;top:663px;left:161px;font-family:'Times New Roman';font-size:11pt;white-space:nowrap;">Skeet Nominees Pty Ltd 2,276,736
    </div>
    <div style="position:absolute;top:663px;left:531px;font-family:'Times New Roman';font-size:11pt;white-space:nowrap;"> 
    </div>
    <div style="position:absolute;top:663px;left:625px;font-family:'Times New Roman';font-size:11pt;white-space:nowrap;">0.84%
    </div>
    <div style="position:absolute;top:663px;left:663px;font-family:'Times New Roman';font-size:11pt;white-space:nowrap;"> 
    </div>
    <div style="position:absolute;top:704px;left:161px;font-family:'Times New Roman';font-size:11pt;white-space:nowrap;">Diederik de Boer 1,917,561
    </div>
    <div style="position:absolute;top:704px;left:531px;font-family:'Times New Roman';font-size:11pt;white-space:nowrap;"> 
    </div>
    <div style="position:absolute;top:704px;left:625px;font-family:'Times New Roman';font-size:11pt;white-space:nowrap;">0.71%
    </div>
    <div style="position:absolute;top:704px;left:663px;font-family:'Times New Roman';font-size:11pt;white-space:nowrap;"> 
    </div>
    <div style="position:absolute;top:744px;left:161px;font-family:'Times New Roman';font-size:11pt;white-space:nowrap;">Ecapital Nominees Pty Limited 1,594,736
    </div>
    <div style="position:absolute;top:744px;left:531px;font-family:'Times New Roman';font-size:11pt;white-space:nowrap;"> 
    </div>
    <div style="position:absolute;top:744px;left:625px;font-family:'Times New Roman';font-size:11pt;white-space:nowrap;">0.59%
    </div>
    <div style="position:absolute;top:744px;left:663px;font-family:'Times New Roman';font-size:11pt;white-space:nowrap;"> 
    </div>
    <div style="position:absolute;top:777px;left:161px;font-family:'Times New Roman';font-size:11pt;white-space:nowrap;">Neweconomy Com Au Nominees Pty 9
    </div>
    <div style="position:absolute;top:792px;left:161px;font-family:'Times New Roman';font-size:11pt;white-space:nowrap;">Limited &#60;900 Account&#62;
    </div>
    <div style="position:absolute;top:784px;left:472px;font-family:'Times New Roman';font-size:11pt;white-space:nowrap;">1,594,7360
    </div>
    <div style="position:absolute;top:784px;left:531px;font-family:'Times New Roman';font-size:11pt;white-space:nowrap;"> 
    </div>
    <div style="position:absolute;top:784px;left:625px;font-family:'Times New Roman';font-size:11pt;white-space:nowrap;">0.59%
    </div>
    <div style="position:absolute;top:784px;left:663px;font-family:'Times New Roman';font-size:11pt;white-space:nowrap;"> 
    </div>
    <div style="position:absolute;top:825px;left:161px;font-family:'Times New Roman';font-size:11pt;white-space:nowrap;">Sonray Capital Markets Pty Ltd 1,236,842
    </div>
    <div style="position:absolute;top:825px;left:531px;font-family:'Times New Roman';font-size:11pt;white-space:nowrap;"> 
    </div>
    <div style="position:absolute;top:825px;left:625px;font-family:'Times New Roman';font-size:11pt;white-space:nowrap;">0.46%
    </div>
    <div style="position:absolute;top:825px;left:663px;font-family:'Times New Roman';font-size:11pt;white-space:nowrap;"> 
    </div>
    <div style="position:absolute;top:865px;left:161px;font-family:'Times New Roman';font-size:11pt;white-space:nowrap;">Argo Investments Limited 1,050,000
    </div>
    <div style="position:absolute;top:865px;left:531px;font-family:'Times New Roman';font-size:11pt;white-space:nowrap;"> 
    </div>
    <div style="position:absolute;top:865px;left:625px;font-family:'Times New Roman';font-size:11pt;white-space:nowrap;">0.39%
    </div>
    <div style="position:absolute;top:865px;left:663px;font-family:'Times New Roman';font-size:11pt;white-space:nowrap;"> 
    </div>
    <div style="position:absolute;top:905px;left:161px;font-family:'Times New Roman';font-size:11pt;white-space:nowrap;">Idameno (No 79) Nominees Pty Limited 724,210</div>
    <div style="position:absolute;top:1103px;">
    </body></html>
    Thanks..........................

  • Read from file and plot data against timestamp

    Hello,
    I know that there are already many posts regarding the question I m about to ask. But, I somehow dont seem to achieve what I want using the suggestions given in the other posts.
    My problem is that, I have a file with the first column as a time stamp containing hour, minute, second and millisecond. The second column in a set of pressure values. I want to plot a graph of these pressure values against the timestamp recorded in this .txt file. Whatever I do, the timestamp values seem to skip by a couple of seconds.
    How do i do this correctly?
    Also, Is it advisable to use the read from file or the read from spreadsheet file vi? Kindly help me out.
    Thanks and regards.

    Hey, I was having a similar issue the other day.  The first problem I had was how to open the file and actually get the timestamp information.  Since I'm using LabView 8.0, I had to go into Read Spreadsheet File and create a new vi to open strings (in an array form).  That's the Read Spreadsheet File (string) vi below.  Then, I had to figure out how to convert the string of a timestamp to something meaningful to me.  The Timestamp2.vi is how I did that below.  I'm also including a little test file.  So, to run Timestamp2.vi, you will have to input the right base path, and have the Read Spreadsheet File (string).vi in the same place as Timestamp2.  Hope that helps.  I think I'm finally getting this stuff, so let me know if it doesn't work.
    Attachments:
    Test.txt ‏1 KB
    Timestamp2.vi ‏28 KB
    Read From Spreadsheet File (String).vi ‏25 KB

  • Read text file and insert into MySQL

    Dears,
    I need to read text file and then insert the data in the correct column in the MySQL database
    example
    I have the following text file:
    field1=1234 field2=56789 field3=444555
    field1=1333 field2=2222 field3=333555
    and so on and so forth ,,note that all rows are identical and just the filed value is changed(there is a dilemeter between fields)
    how can I read field1,field2 and field3 from text file and insert them in the correct table and column in the database.....
    any help?????
    thanks for your cooperation
    Best Regars

    Sure.
    Which part don't you understand?
    1. Reading a text file
    2. Parsing the text file contents.
    3. Relational databases and SQL.
    4. How to create a database.
    5. How to connect to a database in Java.
    6. How to insert records into the database in Java.
    7. How to map Java objects to records in a database.
    This is a pretty nice list. Solve complex problems by breaking them into smaller ones.
    %

  • How to synchronize if one servlet read a file and anothe servlet update the

    How to synchronize if one servlet read a file and anothe servlet update the file at a time?

    Create a class that holds the reference to the file and do the whole file manipulation just in that class. than synchronize the read and write methodes. A reference to this file handler class can be stored to the servlet context in one servlet and read out from the servlet context in the other servlet.

  • Allowing special user to read log files [Solved]

    Hi
    I want to add a group (log) that has the privledges to read /var/log files
    and then add my user to that group.
    How do i accomplish this
    This is to run root-tail in .xinitrc
    Or is there an other way?
    //Clanman

    [root@master fredrik]# ls -al /usr/bin/root-tail
    -rwxr-xr-x  1 root root 22600 2006-01-08 04:58 /usr/bin/root-tail
    [root@master fredrik]# chmod 640 /usr/bin/root-tail
    [root@master fredrik]# ls -al /usr/bin/root-tail
    -rw-r-----  1 root root 22600 2006-01-08 04:58 /usr/bin/root-tail
    [root@master fredrik]# chgrp log /usr/bin/root-tail
    [root@master fredrik]# ls -al /usr/bin/root-tail
    -rw-r-----  1 root log 22600 2006-01-08 04:58 /usr/bin/root-tail
    exiting root
    fredrik@master ~]$ root-tail -g 800x250+10+10 -justify -fn '-*-verdana-*-*-*-*-10-*-*-*-*-*-*-*' /var/log/errors.log,orange,'ALERT'
    -bash: /usr/bin/root-tail: Permission denied
    Still no go
    //Clanman

  • WebAnalyticsServiceApplication_ReportingDB log file and secondary DB files issue

    Hello everyone,
    So we have a problem, a customer has a SP2010 farm, SP on one server and SQL 2008r2 on another. Little (read none by the looks of things) maintenance has been applied to the server (both SQL and SP other than patching and windows backups) over nearly a year
    and we are here now to upgrade to SQL 2012, found the current state and the situation is as follows (up-to now):
    The SP install was done from the search server binaries to give better search options (thought this may be prudent to disclose)
    The WebAnalyticsServiceApplication_ReportingDB log file is HUGE and will not truncate, Ive done the following:
    backed up (full) the DB for web analytics  
    backed up log files for same DB (with truncate selected) (both through gui in SQL MS)
    Tried to shrink log file (this told me through the gui that 99% was free in the log file, but it freed up only 1%, even after trying again and selecting 'reorganise pages before releasing unused space' and selecting 0MB for the 'shrink to' size)
    Also, there are over 30 secondary DB files for this database, Ive seen other threads about these files but am stuck as how to do the following...
    no one uses the web analytics
    the data is not needed
    I understand it maybe needed in the future
    we do not need the data
    how should I get rid and stop future log file and secondary DB file growth? 
    Anyone's help would be greatly appreciated. 

    For reference, you can control how long SP keeps the Web analytics data (which does generate one extra .ndf per week).
    To set the limit on the data retention period:
    On the Central Administration Web site, in the Application Management section, click
    Manage service applications.
    Click the Web Analytics Service Application row to select it and in the
    Operations group of the ribbon click Properties.
    In the dialog box, in the Data Retention Period section, set the data retention period, which can range from 1 month to 25 months.
    See
    https://technet.microsoft.com/en-us/library/ee620541.aspx#section1 for more info

Maybe you are looking for