Here is the text file
Username:user1 Password:pass1
Username:user2 Password:pass2
I want to read the username and password from the text. the problem is there is not way to change the format of the text. i tried to read but as there is not space between colon(:), it gives whole username:user1
as string but i want only user1. i referred to this question but it did not help as there is no space between colon.
I tried :
while ((fscanf(fp,"Username:%s Password:%s",username,password))!=EOF)
but it gives many undefined characters after user1 and loop never ends.