0

I see this to make text file and it also helps me out but in all examples i see that they just making string in notepad or we can say text file... Can any one say that how to make table formatted text file in android??

i want to make file(invoice)

Community
  • 1
  • 1
Vivek Shah
  • 380
  • 2
  • 8

2 Answers2

0

That would be TSV format, and it is very easy to generate. Just add a TAB after every field, and a CR/LF pair after every record.

Philip Sheard
  • 5,789
  • 5
  • 27
  • 42
0

This is most likely going to involve some some slightly messy string processing. Assuming you have your data in an acceptable format (such as string arrays), you should be able to construct a single java string representing the whole table, and then use the code you found already to print it to a file. Use the escape character \t to separate between columns and \n to separate between rows.

Ernir
  • 333
  • 1
  • 8
  • 17