WizardMac / ReadStat

Command-line tool (+ C library) for converting SAS, Stata, and SPSS files 💾
MIT License
273 stars 69 forks source link

Sav file timestamp string is invalid #197

Closed ofajardo closed 4 years ago

ofajardo commented 4 years ago

when reading test_2014.sav an error arises:

readstat-1.1.1$ ./readstat test_2014.sav
Format: SPSS binary file (SAV)
Invalid date string (length=9):  1-Jan- 5
Error processing test_2014.sav: The file's timestamp string is invalid

The file test_2014_working.sav reads correctly. Both files are opened correctly in SPSS 25.

test_2014.zip

ofajardo commented 4 years ago

hi

thanks a lot for fixing! I think that when you did the correction I tested and it was good (can't remember well now). However in the release 1.1.2 the issue seems to be still there:

(base) root@faa8dbc4f212:/myhome/Downloads/readstat-1.1.2# bin/bin/readstat ../test_2014/test_2014.sav
Format: SPSS binary file (SAV)
Invalid date string (length=9):  1-Jan- 5
Error processing ../test_2014/test_2014.sav: The file's timestamp string is invalid
evanmiller commented 4 years ago

Okay - I thought the issue was just the space-padding. But it's also the use of dashes instead of spaces. I will get this fixed in a future update.

evanmiller commented 4 years ago

Try the dev branch

https://github.com/WizardMac/ReadStat/commit/a71b4e80dae729e236d63d42066e79ca646cd23b

ofajardo commented 4 years ago

thanks that solves it!

hmeleiro commented 2 years ago

Hello! I'm having the same issue with a sav file. I'm using R havenlibrary, but the error persists if I use directly ReadStat latest release (1.1.7). The file is correctly open in SPSS.

3361.zip