Xref: utzoo comp.lang.c:39029 comp.misc:12406 Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!usc!alhena.usc.edu!ajayshah From: ajayshah@alhena.usc.edu (Ajay Shah) Newsgroups: comp.lang.c,comp.misc Subject: ATTN: C hacker who loves Awk Message-ID: <32616@usc> Date: 6 May 91 11:53:58 GMT Sender: news@usc Followup-To: comp.lang.c Organization: University of Southern California, Los Angeles, CA Lines: 29 Nntp-Posting-Host: alhena.usc.edu Originator: ajayshah@alhena.usc.edu 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@usc.edu The more things change, the more they stay insane. _______________________________________________________________________________