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 31 32 33 34 35 36 37 38 39 40
|
#include <iostream>
#include <fstream>
using namespace std;
string Weather_ID, Date, Temperature, Maximum_Temperature, Minimum_Temperature, Sea_Level_Pressure, Humidity, PP, Vertical_Visibility, V, VM, VG, Rain, Snow, Thunder_Storm, Fog;
int main()
{
ifstream Weather_test;
Weather_test.open("/Users/MyName/Desktop/Weather_test.csv");
if(!Weather_test)
{
cout << "The file did not open correctly";
}
int row=0;
getline(Weather_test, Weather_ID, ',');
getline(Weather_test, Date, ',');
getline(Weather_test, Temperature, ',');
getline(Weather_test, Maximum_Temperature, ',');
getline(Weather_test, Minimum_Temperature, ',');
getline(Weather_test, Sea_Level_Pressure, ',');
getline(Weather_test, Humidity, ',');
getline(Weather_test, PP, ',');
getline(Weather_test, Vertical_Visibility, ',');
getline(Weather_test, V, ',');
getline(Weather_test, VM, ',');
getline(Weather_test, VG, ',');
getline(Weather_test, Rain, ',');
getline(Weather_test, Snow, ',');
getline(Weather_test, Thunder_Storm, ',');
getline(Weather_test, Fog, '\n');
cout << string(Date);
cout << string(Fog);
return 0;
}
|