Ultimately I need to create a TSV file.
I've been using AngularJS v1.2.20 with the ng-csv module. So far ng-csv is great for csv but it doesnt seem to work well with creating tab separation.
My directive looks like
<a ng-csv='getCSVData()' filename='tsv_data_table.tsv' csv-header='headerNames' field-separator="\t">TSV</a>
but it ends up just putting the raw \t between each of the cells as if I wanted to use "\\t" for example
Bob's Tires\t2484775951\t1\t1\t100\t0\t1\t100\t73\t1
I've tried putting \t in decimal-separator and text-delimiter and it didn't help.
Have you tried putting in \t as an HTML entity? That is, as 	
? Not sure but it might help.
When Angular was reading the field-separator="\t"
it was actually escaping the \
before it passed it to the directive. I made a pull request that got merged into ng-csv that fixed this problem.
So the answer is - it works now to just use field-separator="\t"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With