Re: grep question

From: Sunder Iyengar (Sunder.Iyengar_at_VERITAS.COM)
Date: 03/25/05

  • Next message: Jim Richard: "Re: IBM FastT vs. EMC Clarion"
    Date:         Fri, 25 Mar 2005 10:29:30 +1100
    To: aix-l@Princeton.EDU
    
    

    John,

    If the string to be searched is "abc" in the following file (listing
    below), as per your stated rules (ignore string in the first 8
    characters), then the grep would be as follows.

    # cat sample
    abc1552uenkd
    776wabc288e8e
    12345678abc2663
    7831687138abcjdoiewd
    abdabc3791u312ew1jeo
    dgsaiudadgagdagabc
    1234567abc366dj

    # grep '^.........*abc' sample
    12345678abc2663
    7831687138abcjdoiewd
    dgsaiudadgagdagabc

    Hope this helps.
    Explanation -

    ^=beginning of line
    .=any character
    After a string of 8 . (dots), the ninth . followed by * says zero or
    more characters.

    Sunder.

    -----Original Message-----
    From: IBM AIX Discussion List [mailto:aix-l@Princeton.EDU] On Behalf Of
    John Dunn
    Sent: Friday, 25 March 2005 2:42 AM
    To: aix-l@Princeton.EDU
    Subject: grep question

    I want to search for a lines matching a string in a file, but ignore
    the first 8 characters in each line in the search. However I do not want
    to remove the first 8 characters from the file.

    Can I do this with grep?

    John


  • Next message: Jim Richard: "Re: IBM FastT vs. EMC Clarion"

    Relevant Pages

    • Re: Prothon should not borrow Python strings!
      ... """It does not make sense to have a string without knowing what encoding ... same cul de sac as Python. ... Prothon_String_As_ASCII // raises error if there are high characters ... Python's split between byte strings and Unicode strings is ...
      (comp.lang.python)
    • Re: Letter to US Sen. Byron Dorgan re unpaid overtime
      ... put them in stupid places. ... Programming is difficult (as you must surely appreciate, ... > strings will be in the range 1...1000 characters. ... impose an artificially small limit on string length." ...
      (comp.programming)
    • Re: Fast UTF-8 strlen function
      ... >> Is there a fast UTF-8 string length function floating around? ... Length in bytes, or length in characters? ... For UTF-8, the main basic "change" you have to make to your string routines ... then I could individually look up the characters in my UNICODE ...
      (alt.lang.asm)
    • Re: Byte Array to String
      ... retrieved text will mismatch the original characters. ... encoding the characters. ... Dim strFileData as String ...
      (microsoft.public.dotnet.framework.aspnet)
    • Re: A note on personal corruption as a result of using C
      ... impossible to write effective string validation routines by definition ... (Note that a string literal may contain embedded null characters; ... without resorting to abusive language. ... In practice, programmers typically use "struct" ...
      (comp.programming)