ATTN: C hacker who loves Awk
Ajay Shah
ajayshah at alhena.usc.edu
Mon May 6 21:53:58 AEST 1991
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.
--
_______________________________________________________________________________
Ajay Shah, (213)734-3930, ajayshah at usc.edu
The more things change, the more they stay insane.
_______________________________________________________________________________
More information about the Comp.lang.c
mailing list