Skip to content

TheIrritainer/csv-ids

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

CSV-ids

Sometimes you need to get a list of ids to use in another query from your database tool when you cannot use an inner query.

Often you could resort to making a SELECT with only the id as column, then have to open the file in an editor, remove the first line and then replace newlines with a comma.

CSV-ids does just that (and nothing more). It is a quick helper to get a list of ids from a csv file into your clipboard for macos or linux. Or print it to stdout for further piping

Requirements

  • bash
  • for linux: xclip (available in all package managers)

Setup

  1. Clone the repository
  2. Make a symlink to the script in your bin directory
#for linux
sudo ln -s $(pwd)/csv-ids.sh /usr/bin/csv-ids
#for mac
sudo ln -s $(pwd)/csv-ids.sh /usr/local/bin/csv-ids

Usage

  1. As a command:
csv-ids ~/Downloads/some-query-file.csv 
  1. As a pipe:
cat ~/Downloads/some-query-file.csv | csv-ids

Options:

  • --print: print the ids to the console instead of copying to clipboard

About

CSV ids

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages