Giter VIP home page Giter VIP logo

Comments (6)

chrisbra avatar chrisbra commented on May 12, 2024

e.g. for this file:
First,Second,Third
10,5,2
5,2,10
2,10,5
10,5,2

output it like this:
First, Second, Third
10, 5, 2
5, 2, 10
2, 10, 5
10, 5, 2

(and optionally aligning colums (without the delimiter) like this (for leftaligning):
First ,Second ,Third
10 ,5 ,2
5 ,2 ,10
2 ,10 ,5
10 ,5 ,2

from xsv.

BurntSushi avatar BurntSushi commented on May 12, 2024

That doesn't really make sense to me. What is your use case? xsv table is for making CSV files human readable on the console. Keeping the delimiters in the output conflicts with this goal. xsv table's purpose is to replace delimiters with the right number of spaces.

Aside from that, I'm especially unlikely to implement this. The existing command is especially simple because it relies on an implementation of elastic tabstops.

from xsv.

chrisbra avatar chrisbra commented on May 12, 2024

I am hoping to use xsv if available to arrange csv files within vim. I have a vim CSV plugin, screencast (Look for the :ArrangeCol command) That allows to align csv files and instead of calculating the correct width and aligning it manually, I'd like to use xsv if possible. Because this is faster (which makes a difference for bigger csv files). But this makes only sense, if I can keep the delimiter, and second (optionally) be able to specify how to align certain columns.

from xsv.

BurntSushi avatar BurntSushi commented on May 12, 2024

That's an impressive plugin!

Honestly, I'm not sure that the command you're after is a good fit for xsv. It seems rather specialized and of limited practical use. If you wanted to write a new command called align as part of xsv and it was simple enough, I'd probably be willing to maintain it. But I think that's about the best I can do.

If I saw an easy way to do this on top of xsv table, then I might do it. But unfortunately, most of the complexity is buried in elastic tabstops which has no knowledge of delimiter separated values.

from xsv.

chrisbra avatar chrisbra commented on May 12, 2024

Okay, thanks. I'll check, if csvkit can help me.

from xsv.

BurntSushi avatar BurntSushi commented on May 12, 2024

OK, good luck! As far as I know, csvkit's closest thing is csvlook, but it has lots of formatting that probably won't work for you.

You might also consider investigation the column command that is part of util-linux.

from xsv.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.