Skip to content

Instantly share code, notes, and snippets.

@raveensrk
Created August 27, 2023 08:29
Show Gist options
  • Save raveensrk/eb6d9762287092126b924db88e984279 to your computer and use it in GitHub Desktop.
Save raveensrk/eb6d9762287092126b924db88e984279 to your computer and use it in GitHub Desktop.
How to align a csv file?
#!/bin/bash
columns -t -s "," "$1"
@raveensrk
Copy link
Author

For macOS use this,

#!/usr/bin/env bash

if command -v columns ; then 
    columns -t -s "," "$1"
else
    column -t -s "," "$1"
fi

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment