Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question: output formatting #2

Open
bdmorin opened this issue Jul 20, 2018 · 1 comment
Open

Question: output formatting #2

bdmorin opened this issue Jul 20, 2018 · 1 comment

Comments

@bdmorin
Copy link

bdmorin commented Jul 20, 2018

Are there any plans to do any kind of output formatting? I tried to do something like columns, but I can't zero in on the text with multiple spaces.

 curl -s 'https://www.omdbapi.com/?s=ready&apikey=<>' | jq  '.Search[]' -rc | vj -c Year -p title -s Poster
 2018  Title Ready Player One  Type movie  imdbID tt1677720
 1994  Title Ready to Wear  Type movie  imdbID tt0110907
 2000  Title Ready to Rumble  Type movie  imdbID tt0217756
 2011  Title Ready  Type movie  imdbID tt1708532
 1993–1997  Title Ready or Not  Type series  imdbID tt0106110
 2000  Title Get Ready to Be Boyzvoiced  Type movie  imdbID tt0248036
 2015  Title I'm Not Ready for Christmas  Type movie  imdbID tt5182120
 2003  Title Ready, Steady, Charlie!  Type movie  imdbID tt0353161
 2008  Title Ready  Type movie  imdbID tt1156516
 2009  Title Ready or Not  Type movie  imdbID tt0892094

In this case, the title has variable levels of spaces so column -t just sends the whole thing in disarray. I don't know Ruby, else I'd take a shot at it.

Thanks for writing this exceptionally useful tool!

@m-o-e
Copy link
Member

m-o-e commented Jul 20, 2018

Thanks for your feedback!

At the moment there are no such plans, but
might consider this idea for the next iteration.

For now, as a work-around, you could substitute the
double-spaces to tabs, like so:

curl -s 'https://www.omdbapi.com/?s=ready&apikey=<>' | jq '.Search[]' -rc | vj -c Year -p title -s Poster | sed $'s/ /\t/g' | column -t -s $'\t'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants