1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#pragma once

#include<stdio.h>
#include <iostream>
#include <fstream>
#include <string>
#include <vector>
#include <algorithm>
#include <regex>

using namespace std;

void Parse (string filepath) {
	ifstream sourceFile(filepath.c_str());
	if (sourceFile) {
		for (string line; getline(sourceFile, line);) {
			// remove white spaces (http://stackoverflow.com/a/83538)
			line.erase(remove_if(line.begin(), line.end(), isspace), line.end());
			cout << line << endl;
		}
	} else {
		cout << "Error opening file for parsing.";
	}
}

int main() {
	Parse("D:\\SIMPLE.txt");
	getchar();
	return 0;
}