Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

shell script to extract contents of a file

ajcajc Member Posts: 1
Hi,
I am inserting two eyecatchers into a log file to track the logs in that period between the two. now i wnat to extract the contents between these eyecatchers. Can someone gve me the logic how it should be worked.
im stumped. Im trying to write a unix shell script(korn shell)
regards,
aj

Comments

  • abcabc Member Posts: 443
    : Hi,
    : I am inserting two eyecatchers into a log file to track the logs in that period between the two. now i wnat to extract the contents between these eyecatchers. Can someone gve me the logic how it should be worked.
    : im stumped. Im trying to write a unix shell script(korn shell)
    : regards,
    : aj
    :
    :
    say you have the logfile with a structure like:
    [code]
    ...
    START
    stuff to extract
    END
    ...
    [/code]

    do:
    [code]
    sed -n '/START/,/END/p' logfile
    [/code]
  • Chris BrownChris Brown USAMember Posts: 4,624 ✭✭

    _ < http://forcoder.org /> free ebooks and video tutorials about || Delphi Ruby Perl Visual Basic .NET R Scratch Go Swift PL/SQL C# C Visual Basic Python C++ JavaScript MATLAB Assembly PHP Objective-C Java SAS Rust Logo D VBScript Lua Bash FoxPro Dart Crystal Fortran Lisp Kotlin Julia COBOL Scala Alice Ada Awk Erlang Scheme Hack LabVIEW Apex Transact-SQL Prolog ABAP Clojure F# ML || ________

Sign In or Register to comment.