# Why do some .obj files have no newlines?

I'm working on a game engine and just started with mesh loading. I started with the format .obj. I ran into this problem:

The guide I'm following gave me a couple of .obj files to try and they all worked fine. I then asked a friend who is working with 3D animation to give me a couple of .obj files to try in addition, but his files, when opened up in a txt format, contain no newlines to separate the information at all. (Everything was on one line). The loading function I use depends on this to extract the information.

Are the files he gave me bad in some way? Is my function bad because it depends on newlines being there? (I can't see .obj files having any other delimiter character...)

My friend made and exported the 3D models in Blender. This is the guide I'm following.

• What OS does your friend use? Different operating systems use different newline characters, and it's possible that is causing the issue. – jhocking Jun 14 '13 at 12:27
• He is using windows 7, and so am I, but do you really think the blender export function should be affected by that :O ? – Fredrik Boston Westman Jun 14 '13 at 12:28
• dunno, perhaps it uses system default filestream commands. whatever it doesn't matter now, thanks for crossing off that possibility – jhocking Jun 14 '13 at 12:32
• Windows version doesnt relly matter, locale can affect this too. But it highly probably that its caused by him exporting it with line breaks as \n and you are expecting \n\r. – Kikaimaru Jun 14 '13 at 12:43
• Ok, but to the question at hand, is the file structur of .obj built so you seperate the information via new lines or not :) ? – Fredrik Boston Westman Jun 14 '13 at 14:02

To make sure your parser function works correctly on all platforms, it should consider both \n (newline) and \r (carriage feed) characters as newlines.