I have some code to write data into a CSV file, but it writes data into a CSV without formatting it properly. I want to bold some specific text. Is that possible?
CSV is just a plain text format, so you can't do any formatting.
If you want formatting, consider using an Excel library such as Apache POI or Jasper Reports. (Of course, then you end up with an excel file rather than a CSV, so depending on your situation that may or may not be appropriate)
As a side note, there are some strange nuances to writing CSV (such as making sure quotes, commas etc are properly escaped). There's a nice lightweight library I've used called Open CSV that might make your life easier if you choose to just stick with plain old CSV.
CSV is a plain text file format, you can not use any text effect.
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