Open szabi opened 3 years ago
I think this may not work in some cases, for example, consider this file:
# This is the list that you asked me for, burn after reading!
Name,address
John Doe, 1240 Willow street
Jack Sparrow, Unknown
Anakin Skywalker, Tatooine
In this case, the algorithm you are suggesting would incorrectly consider This is the list that you asked me for, burn after reading!
as the header line instead of Name,address
. BTW you can actually use the virtual header feature to set any line as a header. I understand that it is not convenient to do this manually each time. Another option is to make your algorithm optional by adding a special setting that turns it on (it will be off by default).
I have used the "virtual header" feature, but then it picks up the "# " as part of the first field, even if it is set as the comment sign.
Maybe a solution is to strip the leading comment sign if one of configured from the virtual header's first field?
Ex:
Current behaviour for "virtual header"
# Surname; Name; Number
Leads to column labels
# Surname
Name
Number
=> New behaviour:
Surname
Name
Number
(if comment marker is set to "#"; otherwise unchanged).
Dmitry Ignatovich @.***> schrieb am Fr., 16. Juli 2021, 01:10:
I think this may not work in some cases, for example, consider this file:
This is the list that you asked me for, burn after reading!
Name,address John Doe, 1240 Willow street Jack Sparrow, Unknown Anakin Skywalker, Tatooine
In this case, the algorithm you are suggesting would incorrectly consider This is the list that you asked me for, burn after reading! as the header line instead of Name address. BTW you can actually use the virtual header feature to set any line as a header. I understand that it is not convenient to do this manually each time. Another option is to make your algorithm optional by adding a special setting that turns it on (it will be off by default).
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/mechatroner/vscode_rainbow_csv/issues/90#issuecomment-881066483, or unsubscribe https://github.com/notifications/unsubscribe-auth/AABSPVV6IKOS6A63AVMPWTTTX5THXANCNFSM472MK54Q .
Rainbow csv helpfully allows
The second is particularly helpful with long files and it's "show header on hover" feature.
However, it does not work when the header is not included as a full data line, but in a comment. This feature request is to support column headers in the comments, such as in this example file:
A "full" feature would be to parse all comments prior to the first non-comment lines and look for CSV-formatted lines with the same number of delimiters as in the data part.
A stripped down version of this feature request could demand the header comment to be the only comment before the first data line, though that would limit the added usefulness: