Sign in to follow this  
Riraito

ifstream ignoring characters

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

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