Using C for string search etc

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • brian

    #1

    Using C for string search etc

    I have a set of huge files on which I am doing some typical search and
    replace operations, with the help of sed/awk scripts.

    However for various reasons I have to write C programs instead of
    sed/awk scripts. If someone has experience with C programming with
    string searches, replace etc please let me know, web links, pointers
    etc.
  • Christopher Benson-Manica

    #2
    Re: Using C for string search etc

    brian <brian_dell3@ya hoo.com> spoke thus:
    [color=blue]
    > However for various reasons I have to write C programs instead of
    > sed/awk scripts. If someone has experience with C programming with
    > string searches, replace etc please let me know, web links, pointers
    > etc.[/color]

    The functions declared in <string.h> are useful for searching strings
    - consult your friendly documentation for more details.

    --
    Christopher Benson-Manica | I *should* know what I'm talking about - if I
    ataru(at)cybers pace.org | don't, I need to know. Flames welcome.

    Comment

    • Dan Pop

      #3
      Re: Using C for string search etc

      In <c52db8$hd8$3@c hessie.cirr.com > Christopher Benson-Manica <ataru@nospam.c yberspace.org> writes:
      [color=blue]
      >brian <brian_dell3@ya hoo.com> spoke thus:
      >[color=green]
      >> However for various reasons I have to write C programs instead of
      >> sed/awk scripts. If someone has experience with C programming with
      >> string searches, replace etc please let me know, web links, pointers
      >> etc.[/color]
      >
      >The functions declared in <string.h> are useful for searching strings
      >- consult your friendly documentation for more details.[/color]

      They are useless when the target string is specified as a regular
      expression.

      Dan
      --
      Dan Pop
      DESY Zeuthen, RZ group
      Email: Dan.Pop@ifh.de

      Comment

      • Joe Wright

        #4
        Re: Using C for string search etc

        brian wrote:[color=blue]
        > I have a set of huge files on which I am doing some typical search and
        > replace operations, with the help of sed/awk scripts.
        >
        > However for various reasons I have to write C programs instead of
        > sed/awk scripts. If someone has experience with C programming with
        > string searches, replace etc please let me know, web links, pointers
        > etc.[/color]

        Hi Brian. This is a little vague. If sed/awk works, what might be some
        of the various reasons you must write a new program from scratch? Might
        perl be better than sed/awk for your purposes?

        --
        Joe Wright mailto:joewwrig ht@comcast.net
        "Everything should be made as simple as possible, but not simpler."
        --- Albert Einstein ---

        Comment

        Working...