grist-core icon indicating copy to clipboard operation
grist-core copied to clipboard

Replace headers by a given line

Open yohanboniface opened this issue 2 years ago • 3 comments

Hi,

When a Excel file as noisy first rows, it happens that Grist fails on guessing the headers line. Time ago, we've looked at the back code that handle this part, and arrived at the conclusion that we cannot fix this once and for all (trying to have less false negative will increase false positive, and so on).

But instead, one thing that could help: right-click on a line and "Make headers from this line", that would replace the current headers by the values of that given line.

That would serve as a catch all for any weird case we'll never be able to deal with.

Thoughts ? :)

Yohan

yohanboniface avatar Jan 10 '23 16:01 yohanboniface

I definitely like the idea of offering UI to deal with this. Your suggestion is pretty good. If there were a suggestion that was equally tidy while also easier to find (since I think this is a fairly common problem), I'd be even happier - but I don't have that idea personally :-)

paulfitz avatar Jan 10 '23 17:01 paulfitz

@yohanboniface, do you mean an option in any table view, or only in the import dialog?

Another possibility to help this is if we add an explicit option in the import dialog. The code makes its guess of headers, which determines the headers in the preview. We could also show this guess explicitly as an option, like a Headers from row with a textbox that contains the number of the guessed row with headers (or None if we guessed no headers). The user could then change this option, and see the updated preview, before completing the import.

dsagal avatar Jan 10 '23 19:01 dsagal

Yes, an option in the import dialog would indeed help. The thing is that when you create a new document by importing a file, you do not have this import dialog, afaik. You only have it when importing a file in a already existing document. That's way I was thinking about an action right from the final table.

yohanboniface avatar Jan 11 '23 10:01 yohanboniface