-
Notifications
You must be signed in to change notification settings - Fork 35
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
array.tsv() / object.tsv() #279
Comments
Might as well do CSV at that point 😄 |
odino
added a commit
that referenced
this issue
Sep 10, 2019
Arrays can now easily be formatted as TSV / CSV content: ``` array.tsv() array.tsv(",") ``` Here are some samples: ``` ⧐ [["LeBron", "James"], ["James", "Harden"]].tsv() LeBron James James Harden ⧐ [{"name": "Lebron", "last": "James", "jersey": 23}, {"name": "James", "last": "Harden"}].tsv("\t", ["name", "last", "jersey", "additional_key"]) name last jersey additional_key Lebron James 23 null James Harden null null ``` There is some complexity in this function due to the fact that we have to support custom headers, as well as the fact that we can both format arrays of objects as well as hashes.
odino
added a commit
that referenced
this issue
Sep 10, 2019
Arrays can now easily be formatted as TSV / CSV content: ``` array.tsv() array.tsv(",") ``` Here are some samples: ``` ⧐ [["LeBron", "James"], ["James", "Harden"]].tsv() LeBron James James Harden ⧐ [{"name": "Lebron", "last": "James", "jersey": 23}, {"name": "James", "last": "Harden"}].tsv("\t", ["name", "last", "jersey", "additional_key"]) name last jersey additional_key Lebron James 23 null James Harden null null ``` There is some complexity in this function due to the fact that we have to support custom headers, as well as the fact that we can both format arrays of objects as well as hashes.
odino
added a commit
that referenced
this issue
Sep 10, 2019
Arrays can now easily be formatted as TSV / CSV content: ``` array.tsv() array.tsv(",") ``` Here are some samples: ``` ⧐ [["LeBron", "James"], ["James", "Harden"]].tsv() LeBron James James Harden ⧐ [{"name": "Lebron", "last": "James", "jersey": 23}, {"name": "James", "last": "Harden"}].tsv("\t", ["name", "last", "jersey", "additional_key"]) name last jersey additional_key Lebron James 23 null James Harden null null ``` There is some complexity in this function due to the fact that we have to support custom headers, as well as the fact that we can both format arrays of objects as well as hashes.
odino
added a commit
that referenced
this issue
Sep 15, 2019
Arrays can now easily be formatted as TSV / CSV content: ``` array.tsv() array.tsv(",") ``` Here are some samples: ``` ⧐ [["LeBron", "James"], ["James", "Harden"]].tsv() LeBron James James Harden ⧐ [{"name": "Lebron", "last": "James", "jersey": 23}, {"name": "James", "last": "Harden"}].tsv("\t", ["name", "last", "jersey", "additional_key"]) name last jersey additional_key Lebron James 23 null James Harden null null ``` There is some complexity in this function due to the fact that we have to support custom headers, as well as the fact that we can both format arrays of objects as well as hashes.
odino
added a commit
that referenced
this issue
Sep 15, 2019
Arrays can now easily be formatted as TSV / CSV content: ``` array.tsv() array.tsv(",") ``` Here are some samples: ``` ⧐ [["LeBron", "James"], ["James", "Harden"]].tsv() LeBron James James Harden ⧐ [{"name": "Lebron", "last": "James", "jersey": 23}, {"name": "James", "last": "Harden"}].tsv("\t", ["name", "last", "jersey", "additional_key"]) name last jersey additional_key Lebron James 23 null James Harden null null ``` There is some complexity in this function due to the fact that we have to support custom headers, as well as the fact that we can both format arrays of objects as well as hashes.
odino
added a commit
that referenced
this issue
Sep 15, 2019
Arrays can now easily be formatted as TSV / CSV content: ``` array.tsv() array.tsv(",") ``` Here are some samples: ``` ⧐ [["LeBron", "James"], ["James", "Harden"]].tsv() LeBron James James Harden ⧐ [{"name": "Lebron", "last": "James", "jersey": 23}, {"name": "James", "last": "Harden"}].tsv("\t", ["name", "last", "jersey", "additional_key"]) name last jersey additional_key Lebron James 23 null James Harden null null ``` There is some complexity in this function due to the fact that we have to support custom headers, as well as the fact that we can both format arrays of objects as well as hashes.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add the ability to convert an array / object to TSV. Useful to convert JSON to TSV.
The text was updated successfully, but these errors were encountered: