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

Option to "list" in a different format (raw data) [feature request] #660

Open
RaitaroH opened this issue Dec 9, 2022 · 2 comments
Open

Comments

@RaitaroH
Copy link

RaitaroH commented Dec 9, 2022

Hi,

Thank you for the awesome program. I am heavily using it with my adl script.

I think it would be very helpful, both to me for my adl script, but also others like justchokingaround/trackma-wrapper to allow trackma -a 1 list to output in a different format upon request. What I mean is, by default it shows a table, but for scripting purposes having it in a character delimited format, or even json would be much better.

For example, right now the output looks like this if I copy paste it:

| Index  Title                                           Progress  Score  |
|   1    �[0;34mBlue Lock�[0m......................................   9 / 24   5.5   |
|   2    �[0;34mBocchi the Rock!�[0m...............................   9 / 12   6.5   |
|   3    �[0;34mChainsaw Man�[0m...................................   9 / 12   5.5   |
|   4    �[0;34mDo It Yourself!!�[0m...............................  10 / 12    6    |
|   5    �[0;31mIsekai Oji-san�[0m.................................   9 / 13   6.5   |
|   6    Kyokou Suiri...................................   4 / 12    0    |
|   7    �[0;34mMairimashita! Iruma-kun 3�[0m......................   9 / 21    5    |
|   8    �[0;34mMeitantei Conan�[0m................................ 1066 / ?   7.5   |
|   9    �[0;34mSPY×FAMILY Part 2�[0m..............................  10 / 13    7    |
|   10   �[0;34mTensei Shitara Ken Deshita�[0m.....................  11 / 12    5    |
|   11   �[0;31mUchi no Shishou wa Shippo ga Nai�[0m...............  10 / 13   6.5   |
11 results

This requires a bit of scripting to clean up and to get anime titles, or to use trackma info index which is slow.

As such I believe that following would be much nicer: trackma -a 1 list raw

1|"Blue Lock"|9|24|5.5
2|"Bocchi the Rock!"|9|12|6.5

This allows for very simple awk -F'|' '{print $n}' type commands.

@RaitaroH RaitaroH changed the title Add the option to "list" in a different format Option to "list" in a different format (raw data) [feature request] Dec 9, 2022
@FichteFoll
Copy link
Collaborator

FichteFoll commented Dec 14, 2022

Separating the fields with a tab (or using JSON, as you mentioned) would be a better approach than a |.

@RaitaroH
Copy link
Author

RaitaroH commented Jan 4, 2023

@FichteFoll I made a PR for this. Hopefully it will get accepted.

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