using .find

I'm trying find only the values in this file that have a comma after them and then print them out while ignoring everything else. I'm having some trouble though.

This is the file here.
1
2
3
4
5
6
7
8
9

 	ORG	100
 	LOAD	X
 	ADD	Y
 	STORE	Z
 	HALT	
X,	DEC	49
Y,	DEC	-80
Z,	HEX	0000


And this is what I have so far, but it's not working.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
	fstream sourceCode;
	string token;
	
	
	sourceCode.open("source_code.data", ios :: in);
	
	
	sourceCode >> token;
      
	    if (token.find(','))
	      {
	       
		    cout << token << endl;
		 
	      }

What do I do?
Does anyone happen to know this?
Here's a hint. Read about the return value of std::string::find() here:
http://www.cplusplus.com/reference/string/string/find/
Topic archived. No new replies allowed.