hi

thanks for a good answer. Yesterday after my posting I thought also the 
reason might be in csv. I tried several different programs like Gedit and 
Libreoffice and in the end I managed to import my csv to weewx. 
Unfortunately I did not understand why. 

Now I have to find a reasonable workaround to get csv imported to weewx. 
You might ask why I need this? I'm going to install my Ventus to our 
cottage without PC connection. When I visit my cottage I'd like to read the 
history data from my Ventus W835. The manufacturer of Ventus provide a 
Windows program (Weather Tool v1.exe) to do this, and the output is csv. 

My steps are following
1) download history-data from weather station (Windows)
2) open file in Linux
3) change wind directions (N, E, etc) to degrees
4) merge date and time to one column (maybe not necessary to convert it to 
timestamp?)
5) get rid of BOM
6) import to weewx

Just too many steps to do it regularly. A nice script would help. Maybe I 
have to try to write one.

Or will there be in the future an option to download the history data 
stored in weather station directly to weewx?

regards
Janne

maanantai 23. maaliskuuta 2020 12.32.36 UTC+2 gjr80 kirjoitti:
>
> Hi,
>
> The clue is in the error message. Whatever process you used to create your 
> csv files has resulted in the UTF-8 Byte order mark (BOM) being included at 
> the start of the file and that is upsetting the python csv reader. From 
> memory this issue has occurred before (or perhaps it was some other 
> non-displaying sequence of bytes). In either case it is probably worthwhile 
> adding some code to wee_import strip out any BOMs during the  
> pre-processing of any csv files being imported. In the meantime you should 
> be able to import your data by opening your csv file(s) in a text editor, 
> moving to the start of the file and deleting characters one at a time until 
> the first displayable character (" in data3.csv, t in data.csv) is deleted. 
> Re-type the just deleted character (the file should again look just like it 
> did when opened) and save the file. It should now import without problem 
> (well without the BOM/null byte problem anyway).
>
> Gary
>
> On Monday, 23 March 2020 04:03:54 UTC+10, Janne Prokkola wrote:
>>
>> Hello
>> I've tried to import csv without luck. I get following message.
>>
>> A CSV import from source file '/var/tmp/data.csv' has been requested.
>> Using database binding 'wx_binding', which is bound to database 
>> 'weewx.sdb'
>> Destination table 'archive' unit system is '0x01' (US).
>> Missing derived observations will be calculated.
>> This is a dry run, imported data will not be saved to archive.
>> Traceback (most recent call last):
>>   File "/usr/bin/wee_import", line 834, in <module>
>>     main()
>>   File "/usr/bin/wee_import", line 784, in main
>>     source_obj.run()
>>   File "/usr/share/weewx/weeimport/weeimport.py", line 350, in run
>>     _mapped_data = self.mapRawData(_raw_data, self.archive_unit_sys)
>>   File "/usr/share/weewx/weeimport/weeimport.py", line 558, in mapRawData
>>     for _row in data:
>>   File "/usr/lib/python2.7/csv.py", line 107, in next
>>     self.fieldnames
>>   File "/usr/lib/python2.7/csv.py", line 90, in fieldnames
>>     self._fieldnames = self.reader.next()
>> _csv.Error: line contains NULL byte
>>
>> Any help or ideas? The data.csv is stripped from practically everything 
>> and from csv.conf I have commented nearly all fileds in FieldMap.  Attached 
>> also original data3.csv.
>>
>>
>> best regards
>> Janne
>>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"weewx-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/d8ad1fc2-a81e-4e94-a950-f9718151281b%40googlegroups.com.

Reply via email to