ATTN: C hacker who loves Awk 
Author Message
 ATTN: C hacker who loves Awk

I'm an experienced Awk programmer who's recently started on C.
The biggest thing I miss is the split() function.  If you have
written some such function, could you please donate it to me?  It
will make my life a lot happier.

Thanks,

        -ans.

P.S.: int split(char *s, char **words, char FS)

        takes string s and field seperator FS.  Generates array of
        words in words, function returns number of fields found.
        Weird special hacks:

                - multiple consecutive blank FS are ignored
                        e.g. split("this    is", words, " ") will give
                        fields "this", "is".
                - any other multiple FSs are respected
                        e.g. split("this||||is", words, "|") will give
                        fields "this", "", "", "", "is.

--
_______________________________________________________________________________

                             The more things change, the more they stay insane.
_______________________________________________________________________________



Fri, 22 Oct 1993 19:53:58 GMT  
 ATTN: C hacker who loves Awk
Dr, Dobbs Journal had an article last year about AWK extensions to C.
I don't have it handy here in the office and I don't remember what functions
(or which issue) they created.  It was something I saved for future use
since I use awk a lot too.
-dave


Wed, 27 Oct 1993 01:34:47 GMT  
 ATTN: C hacker who loves Awk
Take a look at the function 'strtok'.  It should be a reasonable excercise
for you to use it to write your own 'split' function.  You'll learn more by
doing it yourself than you would by getting it handed to you.  *:^)


Sat, 30 Oct 1993 01:13:10 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Newbie: separate big .cs file into small .cs files

2. But DO C hackers code concisely?

3. Beware of "C" Hackers

4. A ask for all Hacker

5. for programmers and hackers

6. Hackers!

7. For all hackers(GLOBAL-1.7 for FreeBSD)

8. Any Hackers

9. Beware of "C" Hacker

10. Need HELP by a C hacker....

11. Making A hacker's life h*ll

12. A Script Problem All Hacker Need Solve

 

 
Powered by phpBB® Forum Software