csvtools icon indicating copy to clipboard operation
csvtools copied to clipboard

csvlook implementation

Open kadwanev opened this issue 8 years ago • 6 comments

Great stuff!

What are your thoughts on a csvlook implementation? I imagine it would read the first 100 rows or so and find out the max length of each column and then pad the remaining data to the same width. If any following records go over, then so be it.

kadwanev avatar Apr 27 '16 21:04 kadwanev

Hi,

Not sure what you mean with a csvlook program? Is there a gnu tool equivalent?

At the moment there is no calculation of the width of the columns, and padding is not allowed per standard. Or do you mean for files with unstable number of columns?

My goal is to be standard complaint and map common GNU tools to it.

DavyLandman avatar Apr 28 '16 06:04 DavyLandman

I don't think there's a gnu tool equivalent but it's a part of csvkit: csvlook

kadwanev avatar Apr 29 '16 15:04 kadwanev

Ah, interesting, I can't really imagine that you want to view MBs of csv in this way? looks like a nice tool to inspect some part of the data?

I agree, that this could be an interesting tool to add, we could decide the width of the columns on the first MB (or whatever buffer size used) and use that, but that's not exactly correct...

perhaps a csvhead tool would be more what you'd want..

DavyLandman avatar May 01 '16 15:05 DavyLandman

I've thought about it a bit more, and it could indeed work. The first buffer (1MB) is used to calculate column widths, and the rows are limited to those widths.

DavyLandman avatar Jun 19 '16 11:06 DavyLandman

Great! I think it would work in conjunction with csvgrep and csvcut to take a look at large files quickly and easily. This just sparked the idea for a csvhead/csvtail which would both preserve the header line.

If you want, I'll be happy to take a first crack at csvlook this week.

kadwanev avatar Jun 20 '16 14:06 kadwanev

awesome! looking forward to your pull request ;)

On Mon, 20 Jun 2016 at 16:22 Neville Kadwa [email protected] wrote:

Great! I think it would work in conjunction with csvgrep and csvcut to take a look at large files quickly and easily. This just sparked the idea for a csvhead/csvtail which would both preserve the header line.

If you want, I'll be happy to take a first crack at csvlook this week.

— You are receiving this because you commented.

Reply to this email directly, view it on GitHub https://github.com/DavyLandman/csvtools/issues/9#issuecomment-227156754, or mute the thread https://github.com/notifications/unsubscribe/AAK9ky8hTqZu-3GsbfazZmISu38O4qK_ks5qNqI-gaJpZM4IRYQM .

DavyLandman avatar Jun 20 '16 14:06 DavyLandman