Best way to extract lines from a log file in Linux

My query is that I have a log file which is around 7 GB and I want to extract lines between a certain time range which should total up to half of the size to 3.5 GB. The lines start with a time range like                        “2014-03-11 17:35:00”. I want to extract the lines between “2014-03-11 17:35:00” to “2014-03-11 18:05:00”. What should be the best way as there may be a grep command or a sed command to do it.
I hope, my question is clear.
Please revert with the reply to my query.
Regards

How about the following:
awk '/2014-03-11 17:35:00/, /2014-03-11 18:05:00/' infile > outfile

Similar Messages

  • Best way to extract data from archived cube

    Hello Experts,
    Can anyone tell me best way to extract data from archived cube.
    Basically I am trying to pull all the data from archived cube and then load it into another brand new infoprovider which is in different box.
    Also I need to extract all the master data for all infoobjects.
    I have two options in my mind:
    1) Use open hub destination
    or
    2) Infoprovider>display data>select the fields and download the data.
    Is it really possible to extract data using option (2) if records are too high and then load it into another infoprovider in new system.
    Please suggest me the pros and cons for the two options.
    Thanks for your time in advance.

    Hello Reddy,
    Thanks a lot for your quick reply.
    Actually in my case I am trying to extract archived infocube data and then load it into new infoprovider which is in different system. If I have connectivity I can simply export data source from archived infocube and then reload into new infoprovider.
    But there is no connectivity between those two systems (where archived cube is and new infoprovider) and so I am left with the two options I mentioned.
    1) Use Open Hub
    or
    2) Extract data manually from infoprovider into excel.
    Can anyone let me know which of the two options is the best and also I doubt on how to use excel in extracting data as excel have limit of no.of records 65536
    Thanks
    Edited by: saptrain on Mar 12, 2010 6:13 AM

  • FB: best way to extract CSS from a project created in Catalyst

    I'm posting this on behalf of a question on the Catalyst forum (http://forums.adobe.com/message/2324233#2324233): Once I import a Catalyst project into FB, what's the best way to go about extracting CSS from it so that all the styles aren't inline?

    Any help or pointers will be greatly appreciated.
    thanks,
    Fu

  • Best way to extract data from 2 years records/Numbers files for tax return?

    Hi
    I am wanting to find a way of generating my annual tax returns from my financial records, which will be stored in a separate Numbers file for each Calendar Year.
    As the Tax Year (in the UK) is different from the Calendar Year (in the UK it runs from April 6 to April 5), I would need to extract information from two different Numbers files, to a third Numbers file. Is it possible to do this, and would this be relatively straightforward?
    I'd be interested to hear from others who have used Numbers for a similar purpose, and how they have organised things.
    Thanks
    Nick

    The easiest soluce is to forget the use of separate documents.
    Use one sheet per year and it will be really easy to achieve your goal using only formulas.
    With separate documents, the unique soluce is to use an AppleScript.
    I may write one but I'm a bit tired because I posted a lot of such soluce and in most cases, I don't know if they give satisfaction to the askers.
    Coding for the clouds isn't my cup of tea so I think that for some days, I will leave AppleScript and will work upon the archives of my workshop.
    Yvan KOENIG (VALLAURIS, France) mercredi 4 août 2010 19:15:58

  • The best way to extract data from MySQL

    I have a MySQL db that contains information about whether respondents are coming to an airshow, what days they plan to attend and how will they travel (www.hollisterairshow.com/helpusplan.php . I can export data from this to a spreadsheet as the summary info will only be seen by the organizers but ideally I'd like to create a page that will summarize responses. Something like this:
    Saturday
    Autos: xxxxx Occupants: yyyyyy
    Aircraft: xxxxx Occupants: yyyyyy
    Other: xxxxx Occupants: yyyyyy
    Sunday
    Autos: xxxxx Occupants: yyyyy
    Aircraft: xxxxx Occupants: yyyyy
    Other: xxxxx Occupants: yyyyy
    Camping: xxxxx Occupants: yyyyy
    How did you hear about the Airshow:
    Radio: xxx TV: xxx Newspaper: xxx Magazine: xxx Internet: xxx Other: xxx 
    I thought I would create a couple of recordsets, one for respondents who will attend on Saturday and the other for respondents who will attend on Sunday then all I'd need to do is count the number of respondents and sum the number of occupants for each recordset, and count/ sum campers for the whole file and similarly for the "how did you hear about it" question. Is this the best way or am I missing a more elegant solution?
    Thanks,
    Tony 

    The page I'm trying to create is here www.hollisterairshow.com/plan-results.php and the questionnaire is here www.hollisterairshow.com/helpusplan.php .
    I went ahead and created recordsets using advanced recordsets and these seem to be working, here's a sample SQL
    SELECT *
    FROM plan
    WHERE Saturday = 'Saturday' AND plan.howArriving = 'Auto'
    I created a recordset for each combination of day and transportation mode - six in all
    This selected the correct records.
    To display the count of how many records selected I then used in DW Insert/Data Objects/ Display Record Count/Total Records which generated the following code:
    <?php echo $totalRows_rsSatAuto ?>
    This worked OK - not elegant but OK and I repeated it for each combination of Day and Transportation mode!!
    So there are two problems I'm having:
    I know I can select the records I want but how do I display the sum of the column containing "How many in your party" - i.e. in the PHP code generated above what do I replace $totalRows_rsSatAuto with?
    There are two questions using radio buttons where I'd like to display the count and % for each option selected. I can select all records for these questions but what code do I put to sum the number of selections for each option and what code do I put to calculate the percentage
    I understand the arithmetic involved which is pretty simple but it's the mechanics of coding that has me stumped. It would really help if you could give me a sample for say the "Are you camping overnight" question which has a "Yes/No" option only. In my mundane way I would create two recordsets, one for "Yes" and one for "No", and use the same technique I describe above for counting Total Records in each recordset, but then I'm stuck with how do I calculate and display the percentages. I must be missing something very obvious as I'm sure there just has to be a more elegant solution.
    Thanks so much for your continued interest.
    Tony

  • A real task..( to search and display few lines from a log file)

    have a look at the following link
    http://computing.unn.ac.uk/staff/cgpb2/public_html/log.html
    i need to display to the users only the Hourly Transmission Statistics (Bytes Sent Requests Time) on a tabular format from the above mentioned link.
    t
    his is not easy
    can any one write down the code please..
    thank you very much.

    What have you done so far?
    What kind of approach are you going to take (aside from asking others to do it all for you)?
    Have you written the algorithm in psuedo-code? If so, can we see it? We might be able to give you a few pointers.

  • HT1338 best way to extract a video from a website?

    what is the best way to extract a video from a website? THANKS!

    how bout a bit more thought on this one, some people are trying to pull a video clip from their 15 seconds of fame on channel 7 news,
    or perhaps a short intro video clip, on a site they own becuase it is playing as flash. since they never had hard copy of the video clip, its difficult to ask themselves for permission, if they don't know how, which is, i'm sure, why this fellow did indeed ask.
    no such thing as dumb questions...just helpful ones that others may also wonder.

  • Best way to extract all images from Messages?

    My iPad freaked out earlier today and unfortunately I had to do a recovery and restore (from iCloud backup).  I say unfortunately because I was 90% certain I was not backing up photos/video (and there was no way to check before doing the restore).  And indeed I had photo/video backup turned off.
    I'm mostly back to normal now, except for all the lost photos/videos.  I've gone through some of Messages to Save ones I sent there. 
    What is the best way to extract all images from past Messages so I don't have to tediously load earlier messages?   I understand there are some programs that allow one to go through a local backup and go through messages.  But for this I suppose I'd first need to make a local backup of everything, no?  Are those programs able to extract just images I've sent or do they grab everything (i.e. images others have sent me?)
    Related, before I did the initial restore could I have easily retrieved the photos/images on the device through some third-party solution?
    Lastly, and semi-off topic.. What determines the image name for an image in Messages?   For example, I Copied a photo someone sent me via Messages and Pasted it three times back to her (all at the same time).   The image filenames are IMG_6447.jpg,  IMG_4820.jpg, IMG_0291.jpg.  

    Thanks Kirby.  I utilize Aperture 3 by reference instead of a compiled library.  So I have individual folder/projects stored on my laptop.  By exporting as a library, does Aperture bring these folders and related images "with it"?
    What I don't want to lose is any post processing I do in the field which creates separate versions and/or .PSD files.
    Thanks for your continued assistance.
    Chris

  • What is the best way to extract/consume HR data to and from Peoplesoft?

    I have to do integration between Peoplesoft and Oracle ERP to send HR data from Peoplesoft to Oracle HRMS. I will use Oracle Fusion Middleware for building the interface. I don't have much experience in working with Peoplesoft tools, like PeopleTool, App Engine, Integration Broker, Component Interface and Oracle adapter for Peoplesoft. Can somebody please let me know what is the most popular or recommended or best way to extract HR data from Peoplesoft.
    The second interface will consume some HR data from Oracle. Once again I need to know different ways to insert data into Peoplesoft.
    I appreciate if you can share your experience for the above two scenarios.

    If you plan on buying a apple laptop you have two options. You can use time machine or pull the data off of it directly and put it onto the external. I advise the second choice. This way you do not have stuff that you dont need filling up the space on your new drive. Get your applications, music, documents, photos, videos and perhaps downloads and desktop; Put all of these on your external. And then reinstall osx onto your drive.
    *** If buying a windows machine next check the format of the drive in disk utility. You will need a program called Paragon NTFS to format the drive window compatibility. You have to pay for the free version but can download a trail version for free.
    http://www.paragon-software.com/home/ntfs-mac/
    Did i leave anything unanswered?

  • Best way to extract this info?

    Hello:
    I have information stored in xmltype as follows:
    <INFO>
    <ASG>
    <LMT id="A1">
    <LMT_VAL>7</LMT_VAL>
    </LMT>
    <LMT id="B1">
    <LMT_VAL>6</LMT_VAL>
    </LMT>
    </ASG>
    </INFO>
    The above info may be dynamic. Example, for some types, There may be additional LMT element with a value of C1 and D1. So what is the best way to extract all of them (A1, B1, C1, D1) - even though in some cases only A1 and B1 may be present?
    Do I have to extract like:
    select ...
    where
    t1.xml.col.extract('/INFO/ASG/LMT/LMT_VAL/@id').getStringVal() = 'A1'
    Do I have a condition like this where ... = A1
    Any help appreciated.

    Hi,
    one left round bracket is missing
    TABLE(xmlsequence(extract (<b> (</b><---missing SELECT xml_column FROM your_table)....If you have more then one row in the table it's not working!
    SQL> CREATE TABLE test_xml(
      2   id NUMBER
      3  ,xml_col XMLType)
      4  /
    Table created.
    SQL> INSERT INTO test_xml VALUES(1,xmltype('<INFO>
      2  <ASG>
      3  <LMT id="A1">
      4  <LMT_VAL>7</LMT_VAL>
      5  </LMT>
      6  <LMT id="B1">
      7  <LMT_VAL>6</LMT_VAL>
      8  </LMT>
      9  </ASG>
    10  </INFO>'))
    11  /
    1 row created.
    SQL> INSERT INTO test_xml VALUES(2,xmltype('<INFO>
      2  <ASG>
      3  <LMT id="A1">
      4  <LMT_VAL>7</LMT_VAL>
      5  </LMT>
      6  <LMT id="B1">
      7  <LMT_VAL>6</LMT_VAL>
      8  </LMT>
      9  </ASG>
    10  </INFO>'))
    11  /
    1 row created.
    SQL> SELECT extractvalue(column_value, '/LMT/@id') new_id,
      2         extractvalue(column_value,'/LMT/LMT_VAL') new_value
      3  FROM TABLE(xmlsequence(extract ((SELECT xml_col FROM test_xml), '/INFO/ASG/LMT')));
    FROM TABLE(xmlsequence(extract ((SELECT xml_col FROM test_xml), '/INFO/ASG/LMT')))
    ERROR at line 3:
    ORA-01427: single-row subquery returns more than one row
    SQL> spool off;

  • Best way to extract XML value wiith an xpath

    Hello,
    I wonder what is the best way to extract text value from XmlType with an xpath.
    I need to insert a row inside a table where the row's data come from xpath extractions of an XmlType. I do a lot of (approximative 20) :
    EXTRACTVALUE(var.myxmltype , '/an/xpath/to/extract/elem1').
    EXTRACTVALUE(var.myxmltype , '/an/xpath/to/extract/elemI').
    EXTRACTVALUE(var.myxmltype , '/an/xpath/to/extract/elem20').
    inside the insert statement
    Is this way is the best or is there a more optimal way ?
    For example extracting the node '/an/xpath/to/extract/' and sarting from this node extracting "elem1", ... , "elemI", "elemN" children.
    Thanks for your help,
    Regards,
    Nicolas

    Hi Nicolas,
    The answer depends on your actual storage method (binary, OR, CLOB?), and db version.
    You can try XMLTable, it might be better in this case :
    SELECT x.elem1, x.elem2, ... , x.elem20
    FROM your_table t
       , XMLTable(
          '/an/xpath/to/extract'
          passing t.myxmltype
          columns elem1  varchar2(30) path 'elem1'
                , elem2  varchar2(30) path 'elem2'
                , elem20 varchar2(30) path 'elem20'
         ) x
    ;

  • Best way to extract XML data to DB

    Hello,
    In our work we need to extract data from XML documents into a database. Here are some extra notes:
    + There is no constant schema for the XML documents.
    + Some processing on the XML files is required.
    + The XML documents are very big.
    + The database is Oracle 8i or 9i (Enterprise Edition both) and our framework is NET.
    Our questions are:
    1. What is the best way to extract the data into the database under the above circumstances ?
    2. In case there was a constant schema for the XML documents, would there be a better way ?
    3. Is writing the data to text files first, and then loading it via SQL-Loader is an effective way ?
    Any thoughts would be welcome. Thanks.

    Hi Nicolas,
    The answer depends on your actual storage method (binary, OR, CLOB?), and db version.
    You can try XMLTable, it might be better in this case :
    SELECT x.elem1, x.elem2, ... , x.elem20
    FROM your_table t
       , XMLTable(
          '/an/xpath/to/extract'
          passing t.myxmltype
          columns elem1  varchar2(30) path 'elem1'
                , elem2  varchar2(30) path 'elem2'
                , elem20 varchar2(30) path 'elem20'
         ) x
    ;

  • SD reporting- best way to extract SD contracts data

    Hi All,
    I want to know what is the best way of extracting the SD contracts data from the VEDA table & the technical objects attached to the contracts(which are in tables like SER02, OBJK etc..). Is it possible to enhance the 2LIS_11_VAITM datasource with these fields? or there is a better way of doing this? Is there a standard datasource that can be used?
    Any helpful information will be appreciated.
    Thanks,
    Shilpa

    You can create a User Exit in CMOD for the 2LIS_11_VAITM DataSource to get the data. There should be a 1:1 (equi or inner join) or 0:1 (outer join) relationship of the data that you want to include, so that you don't create duplicate data.
    Another option would be to create generic DataSources and join the data in BW.

  • How is the best way to remove something from a photo?

    How is the best way to remove something from a photo?

    This is difficult to answer without fully knowing what you are trying to do.
    That said, a few excellent and user friendly retouching tools include:  The Spot Heealing Brush Tool, Healing Brush Tool, Patch Tool, and the Cloning Stamp Tool.

  • How is the best way to read data from an iphone if you lost your itunes data after a crash?

    How is the best way to read data from an iphone if you lost your itunes data after a crash?

    How is the best way to read data from an iphone if you lost your itunes data after a crash?

Maybe you are looking for