Recommend a new approach. When code needs to read a line of text, start with fgets. The classic approach is to use a " " in the fscanf to consume these various white-spaces.
IMO, the Summertime - The Hi-Los - Reflections in Rhythm with The Hi-Los! first step in reading a Come An Get It - Whitesnake - mp3 of text is to use fgetsthen parse. Yes a space before the ","will pass spaces after the number and before the comma. Learn more. Different characters at end of line when using fscanf in Windows and Linux Ask Question.
Asked 3 years, 11 months ago. Active 3 years, 11 months ago. Viewed times. By doing what you suggest, would it work? GPwoopzi Are you trying to say that you're not allowed to change the files? I suggest reading the dos2unix man page if you have problems using it Weather Vane Weather Vane Yes, best way to handle text files with variant line endings. But since you are now using sscanf to extract the fields, there is no need to even remove the newline. The following will accept and consume candidate line ending in 5 places - not only at the end.
Sign up or log in Sign up using Google. Sign up using Facebook. Sign up using Email and Password. Post as a guest Name. Email Required, but never shown. A holiday carol for coders.