Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reformat csv to fixed width: header names are always removed #58

Open
Pierre-de-la-Verre opened this issue Apr 2, 2023 · 3 comments
Open
Labels
enhancement New feature or request

Comments

@Pierre-de-la-Verre
Copy link

Pierre-de-la-Verre commented Apr 2, 2023

(I almost posted this topic on the NPP-Plugin forum https://community.notepad-plus-plus.org/post/85307 , but I was told to post it here)

I tried to reformat a CSV with semicolons as separators to a "Fixed Width"

a) Problem: my header line was totally removed
b) Suggestion: It removed also all separators, and now I have a long "stringwereallpartsare" concatenated. I think the feature in UltraEdit to keep the separators is a fine thing.

Images / screenshots can be seen in the NPP-forum - link in first line.

Thanks and regards!

@rdipardo
Copy link
Contributor

rdipardo commented Apr 2, 2023

The reformat function does not preserve the original text encoding: #52

In some cases that will cause data loss, as the reformatting can accidentally replace some bytes with "invisible" non-printing ones.

@BdR76
Copy link
Owner

BdR76 commented Apr 4, 2023

About point b) it looks like you're trying to convert a semi-colon separated data file to a vertically aligned, but still semi-colon separated, data file. To do that you can go to the menu Plugins > CSV Lint > CSV Lint window, press "Reformat" and select Align vertically and Re-apply quotes = None/minimal and no other options, and press "Ok"

csvl_lin_issue_58

As for point a) you selected Column separator = {Fixed width} and that will cause it to use the column widths in the current metadata definition, so the bottom left textbox with "Col1=Counter Integer Width 2 etc". You could do it this way, but you would first have to manually change all the Width properties of all the columns, so "Col1=Counter Integer Width 7" or something like that, and then Save (blue disk) and then reformat.

The column headers are not included when you convert from character separated to fixed width output, this is hardcoded but I guess it can be adjusted. In practice this will almost always truncate the header names though, I'll have to test it first.

@BdR76 BdR76 added the enhancement New feature or request label Apr 4, 2023
@BdR76 BdR76 changed the title Reformat: Deleted header, missing separators Reformat csv to fixed width: header names are always removed Apr 4, 2023
@Pierre-de-la-Verre
Copy link
Author

@BdR76
thanks a lot - works fine. Great!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants