Sign in to follow this  

ifstream ignoring characters

This topic is 3201 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

is there a way to have the >> operator of fstream ignore special characters other than whitespaces. I would like to have it ignore ',' and ';' and I just wanna make sure I don't have to write my own routine for it.

Share this post


Link to post
Share on other sites
While there might be better ways to do this, I would read the file into a std::string, and then use boost tokenizer to break it up into the segments you want. I don't know of another way to do it, but I hope to see some clever alternatives.

Share this post


Link to post
Share on other sites

This topic is 3201 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this