tabs - How can I capture with fscanf, in C, strings from a file separated by tabulators -


for example following text (in file):

18[tab]robert[tab]nice see again

i want code capture: - 18 - robert - nice see again

i tried fscanf(file,"%s\t",buffer) captured words separated spaces

thanks

use character set, i.e. fscanf(file, "%[^\t]\t", buffer);

the ^ means "all characters except following".

remember check return value.


Comments

Popular posts from this blog

1111. appearing after print sequence - php -

java - WARN : org.springframework.web.servlet.PageNotFound - No mapping found for HTTP request with URI [/board/] in DispatcherServlet with name 'appServlet' -

node.js - Express and Redis - If session exists for this user, don't allow access -