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

html - Outlook 2010 Anchor (url/address/link) -

javascript - Why does running this loop 9 times take 100x longer than running it 8 times? -

Getting gateway time-out Rails app with Nginx + Puma running on Digital Ocean -