BdR76 / CSVLint

CSV Lint plug-in for Notepad++ for syntax highlighting, csv validation, automatic column and datatype detecting, fixed width datasets, change datetime format, decimal separator, sort data, count unique values, convert to xml, json, sql etc. A plugin for data cleaning and working with messy data files.
GNU General Public License v3.0
151 stars 8 forks source link

Missing Characters after Reformat #79

Open njascgil opened 7 months ago

njascgil commented 7 months ago

A strange issue: if I delete a line then immediately proceed to reformat the CSV file (with "Align vertically"), the first character of the line below the one deleted disappears. If, on the other hand, I save the file before reformatting, everything appears to be fine.

This happens to me in this file, for instance: courseid_319_participants-01.csv

BdR76 commented 7 months ago

Thanks for posting this issue, I see the same thing and the steps to reproduce this are:

  1. Open the CSV Lint window
  2. Open the test data file
  3. Select the first data row (starting with "João,Barreiras..")
  4. Delete the entire row (including the newline)
  5. Quickly press the CSV Lint button Reformat
  6. Reformat to "Align vertically" or "Tab-separated" etc.

The result is that it cuts off the first character of the next line Filipe,Brito.. to just ilipe,Brito... The exact Reformat options don't really matter, and the same issue would happen if you select Sort or Add column instead of Reformat. Basically it happens when CSV Lint has to rebuild the data file in some way.

Like you said, if you save the file before reformatting it doesn't happen. But also, when you wait like 5 seconds after deleting the line, it also doesn't happen (!?).

It's very strange and I have seen this before. It has to do with Notepad++ caching the textfile data and it somehow ending up not being synchronised after you edit text. I'll have to look into this, but it's a long-standing issue and I'm not sure what I can do about this.