Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uunet!rufus!corvair.almaden.ibm.com!ebm From: ebm@corvair.almaden.ibm.com (Eli Messinger) Newsgroups: comp.lang.c Subject: Scanf question Message-ID: <268@rufus.UUCP> Date: 9 Oct 90 21:21:17 GMT Sender: news@rufus.UUCP Reply-To: ebm@ibm.com Organization: Pandora's Box Lines: 25 I'm trying to scan a formatted line that looks like: ccssss(tab)number(tab)number(tab)number\n Where c are single characters, and s is a >=0 character string. Originally I tried using the format string: "%c%c%s%n%n%n" which failed, as the %s string must be blank or \n terminated. Next I tried: "%c%c%[^\t]%n%n%n" which failed when the string was null, since the [^\t] must apparently match at least one character for the scanf to continue. My only solution so far is to split the scan in two, scanning the first three and last three parameters separately (searching for the tab in between). Anyone have a better suggestion? Email please. -- "Hang on to your ego." --Brian Wilson CSNET: ebm@ibm.com / UUCP: ..!uunet!ibmarc!ebm / BITNET: ebm@almaden