Author Topic: Meteotemplate setup: Import of CSV data  (Read 957 times)

0 Members and 1 Guest are viewing this topic.

Offline lobsterman

  • Senior Contributor
  • ****
  • Posts: 164
    • Cape Small Harbor Weather
Meteotemplate setup: Import of CSV data
« on: March 03, 2017, 11:42:29 AM »
I am working on importing data which has been exported from MySQL and is generated by a Meteobridge unit. The CSV file has a header line and I have checked that box.

The Show Filed Numbers returns this:
Quote
Loading file...

Loading CSV/text file from /Users/house/Documents/Software/Weather/SQLexport/spweather-export.csv

File loaded successfully.
Header row in the file, skipping first line, using for field labels.

Starting to parse data....

Loaded data:
Field   Field Number   Value (first data set)
0   

One line of the CSV file data looks like this:
Quote
2,"2016-09-07 12:02:15",72.1,84,30.09,67.1,72.1,72.1,80.4,58,0.0,0.9,57,"ENE",2.9,104,"ESE",0.00,0.00,0.00,0.00,0.00
where that first number is an ID nbr.

The Meteotemplate Test Import gives me two results:
1)
Quote
Checking date and time...
There seems to be a problem with the date and time. Either it has not been parsed correctly or it is a date/time in the future! Check the format you specified and also the actual values.
My time settings on the import page are:
Quote
Y-m-d H:i:s

2)
Quote
Minimum pressure allowed: 25 inhg
Maximum pressure allowed: 32 inhg
Pressure is outside the allowed limits! Pressure value will be ignored!
As you can see in the line above the pressure readings in the data are around 30 (30.09)and some lower but all within that range.

Advice would be most welcome

Offline Jáchym

  • Meteotemplate Developer
  • Forecaster
  • *****
  • Posts: 8605
    • Meteotemplate
Re: Meteotemplate setup: Import of CSV data
« Reply #1 on: March 03, 2017, 11:56:17 AM »
Hi,
you need to get rid of the question marks in the file, just bulk replace them in some text editor with "nothing" to get rid of them

For pressure, make sure you put field number 4, in PHP, counting always starts with a 0, so fifth value is number 4