Comments (8)
Also, for what it might be worth, the columns do work correctly if I open the CSV lint panel in one of the files that does work then copy/paste the scheme over. Not sure if that matters at all.
from csvlint.
Thanks for describing your issue, it sounds interesting, probably some edge case in the data. Yes I am interested in seeing the file to see if the plugin can be fixed. You can send the non-working file to my e-mail (see at bottom main github page) I wouldn't recommend posting your data publicly here on github.
Also, recently I fixed a bug in the csv detection part, see this commit. Does your file contain any CrLf's, so quoted strings with new lines/carriage returns in them? If so, then maybe it's already fixed when you use the "beta" build DLL of the plugin?
from csvlint.
Without knowing what's in the data file, I can't reproduce your error. You can find my e-mail at the bottom of the page here.
I'll close this issue for now. When I receive an example file then this one can be re-opened.
from csvlint.
Sorry for the delay. Email sent with example files.
from csvlint.
I received the data through mail, thanks. In the file that isn't properly detected, it looks like some values in the second column contain a comma ,
but they aren't quoted. That messes up the auto-detection.
I won't repeat your data here, but for example your data is something like this
Time,Name,Status
2023-04-12 17:18:15,DOUGLAS,Completed
2023-04-12 17:20:44,FLORES,DE,Completed
2023-04-12 17:21:51,MURPHY,Completed
But it should be like this, with quotes
Time,Name,Status
2023-04-12 17:18:15,DOUGLAS,Completed
2023-04-12 17:20:44,"FLORES,DE",Completed
2023-04-12 17:21:51,MURPHY,Completed
Either the second column should have quotes, or it should use a different separator, that would also avoid this issue. So using tabs or semicolons instead of comma.
from csvlint.
There already were some updates in the latest development release of the plug-in, and that particular file will be correctly detected automatically. However, the problematic lines in the file will never be parsed correctly (by any app or program) because the extra comma causes all subsequent values to be "shifted" one column over to the right.
In the current version of the plugin, you can go to Plugins > CSV Lint > CSV Lint window
, uncheck the "auto-matic" checkbox, press "Detect columns" and then manually select comma ,
as separator and press OK. If you then press "Validate data" it will display validation errors "error line 5: Too many columns, error line 7: Too many columns, error line 11.." etc. for every line where the name contains a extra comma ,
. Btw also notice how the column colors at the end of those lines are different, that's an indication that all values have shifted to right.
from csvlint.
That makes complete sense, but unfortunately if I was able to customize the data that was being exported from the particular program my primary need for CSVLint would actually be gone. One of my main use cases for it is so I can skim the exported data and tell by the color if something got put in the wrong column and just delete the extra comma so things render properly in Excel. The extra commas breaking CSVLint is a cruel irony for me there lol.
from csvlint.
If the only issue with the file is the incorrect commas in the second column, then I would just pre-process all files using a Python script, instead of manually removing the commas. So something like:
# repare incorrect csv file
# check if too many column (=2nd column contains unquoted comma)
import csv
input_file = "Not Working File.csv"
output_file = "Not Working File(2).csv"
# prepare writing to the new output file
with open(output_file, 'w+', newline ='') as outfile:
# prepare reading from the input file
with open(input_file) as file:
newcsv = csv.writer(outfile)
for line in file:
data = line.strip().split(',')
# expected 16 columns, if more then fix it
if len(data) > 16:
# merge 2nd and 3rd value and remove 3rd value
value3 = data.pop(2) # 3rd; zero based
data[1] = (data[1] + ',' + value3)
newcsv.writerow(data)
from csvlint.
Related Issues (20)
- When Transparant cursor true, Notepad++ crash at startup in certain circumstances HOT 1
- Conversion to JSON is extremely slow HOT 3
- Plugin management of NPP shows old version HOT 3
- Validate data : not a valid integer value HOT 2
- Bug when used with another plugin (CSVLint and ComparePlus) HOT 2
- Lock first row when scrolling HOT 4
- multi-byte separator characters get split into their byte-components (unicode, UTF-8) HOT 1
- Transparent cursor line turns completely black when changing style in NPP 8.6 HOT 13
- Respect escaped commas HOT 2
- Missing Characters after Reformat HOT 1
- 我觉得你这个颜色按钮位置有问题. 我找了一天都不知道在哪里 HOT 11
- csv repair and troubleshooting HOT 2
- Opening a dialog from the CSV Lint window causes NPP to hang if the window is undocked HOT 6
- Transparent cursor breaks custom colors HOT 1
- Ctrl+C and Ctrl+X no longer work in forms for Notepad++ 8.6.1 and newer. HOT 3
- ..is not a valid enumeration member, detecting enumeration should ignore certain cases HOT 2
- CSVLint plug-in crashing when opening an SQL file (should not automatically parse non-CSV files) HOT 8
- Reformat, Sort and Add Column changes CRLF to LF HOT 2
- Not getting highlighting
- CSVLint causes Notepad++ crash when attempting to open file with more than 2**31 - 1 bytes
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from csvlint.