roskakori / cutplace

validate data stored in CSV, PRN, ODS or Excel files
http://cutplace.readthedocs.org/
GNU Lesser General Public License v3.0
18 stars 20 forks source link

ERROR:cutplace:field type part must be a single word, but after 'Integer' there also is '' #121

Closed JonathanXC closed 2 years ago

JonathanXC commented 5 years ago
2019-05-22 19_20_27-cid_customers_with_types_and_rules - Excel

Running cutplace 0.8.8, I'm trying to undertake basic validation of a CSV file. When a run cutplace cid_customers_with_types_and_rules.ods customers.csv I see next: ERROR:cutplace:cid_clientes.ods (R12C5): field type part must be a single word, but after 'Integer' there also is ''

For validations Example | Empty | Length all is correct I don't understand because I download file cid_customers_with_types_and_rules.ods file from the page

damiendurant commented 5 years ago

Hi,

I have also different behaviour with python 2.7 on linux and windows. It seems it's linked to the tokenize lib. I have PR a quick fix.

sepira commented 4 years ago

I am still having this issue. Anybody know a fix on this?

damiendurant commented 4 years ago

The PR I've made is a quick and dirty fix. I use it sometime on my CI/CD with no issue yet.

kevalkothari commented 4 years ago

image

I have similar error - Any solution for it?

preetimandole9 commented 3 years ago

Facing same error in python 3.7 . Anyone has got any solution to fix this issue

vikaschoudhary89 commented 2 years ago

This is not working guys and still getting the same issue, would there be any fix for this or this is an orphan library.

also csv file coverts to lowercase so making D as 'd' and F as 'f' and creating the issue.

please let me know

roskakori commented 2 years ago

Hm, looks like this is related to the ODS reader which AFAIR in its core is a fairly simple XML parser. So maybe LibreOffice changed something that introduces spurious empty strings to it.

Does this still happen if you save the CID as Excel?

roskakori commented 2 years ago

This error apparently is caused by a change in the Python tokenizer which at some point started adding a newline token even if you feed it a line with a single word and without a newline.

This is easy enough to fix but boy, the messy build processes and tools for Python projects changed since 2015... 🤮

roskakori commented 2 years ago

It's fixed in the repo but there won't be a release until I rework the build process.

vikaschoudhary89 commented 2 years ago

Thanks @roskakori Yes, I tried in excel and csv and I was getting that error "found d' , 'f' but expected 'D' or 'F' even though I am providing in capital.

Any idea when this will be released?, Thanks again for your help

roskakori commented 2 years ago

Any idea when this will be released?, Thanks again for your help

As of now it's available from PyPI: https://pypi.org/project/cutplace/.