Writing Excel file with SuperCsv including font formatting - supercsv

I use SuperCSV to write Excel files. How can I add font formatting to some of the cells - strikethrough etc.?
Thanks!

If you're using SuperCSV to write an "Excel" file, you're just writing out a comma delimited file. If you need to start getting fancy and trying to add fonts, colors and other formatting tools, it may be time to step up from CSV as an output to an actual XLSX / XLSM. There is a tool out there called Apache POI. We use that on my team for when we need to have full featured Excel files. You can find it here: http://poi.apache.org/ Just be forewarned that conversion from SuperCSV to POI is not a fast or easy conversion.

Related

How do I find formatting settings for CSV on Mac?

I have a Python program that extracts data from an API, applies transformations, and converts it to a csv to be used in Tableau. When I view the file in excel and Google Sheets, it looks fine. No data formatting or read errors as it is formatted in standard UTF8.
When I read it in Tableau, different story. You will notice how the columns lose shape and get parsed incorrectly.
I am thinking it has to do with the fact that my data set is text heavy and contains punctuation, but I have been able to work with data in this format just fine without having to do any custom formatting.
It looks like your csv has multiline fields (which are quoted).
You'll somehow have to tell the Tableau reader/parser to read your data as quoted (and multiline).
Also check the escaping of the quotes (if they are inside a field) - usually this is done with another quote, but could also be with a backslash.

Gnuplot, how to plot data from a file .dat (No data in plot problem)

I am using Gnuplot on windows 10, I need to plot some file excel and to do that I copied and pasted evrything in a .dat file (ANSI), but everytime I try to do a simple plot (I mean the only "plot" command) I have this " warning: Cannot find or open file "FolderWhereFileIsLocated/filetoplot.dat"
No data in plot
And of course it is not empty, the file contains this: enter image description here
The file is saved as a .dat , I've also checked many questions about issues like this but I did not have solved, I've also tried to download from the web some other .dat files to test them but without any results.
Can someone please explain me step by step what can I do to make Gnuplot plot my .dat files?
Thanks in advance.
You should take care that your columns are properly separated. In the image you attached are a bunch of white spaces and then a comma separated pair of values, or do you use the comma as decimal symbol?
Save the spreadsheet directly using excel (eg. as csv type and name it *.dat if you want to have it ending like this) and then try to plot it once more.

ruby excel - write data to existing xls

I have tried different gems in ruby and also searched a lot but Ruby doesnt seem to have a solution to write to existing excel file.
my excel file 'services.xls' has 3 columns
1st column name is 'inputxlm'
2nd column name is 'methodtoexecute'
3rd column name is 'output'
i have internal logic which takes the inputxlm, process it using the method and generates output
How do i write back the output to output column in 'services.xls' ?
Note : I dont want to use win32ole as my organization has some limitation on it
This article is a great source to find out which library suits you best: https://spin.atomicobject.com/2017/03/22/parsing-excel-files-ruby/
My company uses axlsx combined with axlsx_rails to render xls files with Rails rendering machine and axlsx_styler for styling.
Note that in a simple use case like the one you describe, you night not need an excel file like xls, a mere CSV would suffice, and for that, Ruby has CSV

Downloading open street map data in pbf format

I want to download data of a specific area from open street map. Whenever I try to export from openstreetmap.org it downloads the data in .osm format but I want the data to be in .pbf format. I have tried converting .osm file to .pbf file using osmconvert.exe but whenever I try to open the converted file in a text editor ( geany to be specific) it shows nothing. But when I tried opening the converted file in vim there was something but not readable. Can someone suggest me a way to download the data of specific area from open street map in readable pbf format?
For downloading area specific OSM files I would like to recommend the service of Geofabrik:
http://download.geofabrik.de/
The format .osm usually is human-readable since it's XML-structured text.
The format .pbf is not human-readable because this is a binary format. PBF-formatted OSM data are highly compressed and need to be converted (for example to .osm or to .csv) before you can read them.
Further information can be found in OSM Wiki:
https://wiki.openstreetmap.org/wiki/OSM_XML
https://wiki.openstreetmap.org/wiki/PBF_Format

Pig - load Word documents (.doc & .docx) with pig

I can't load Microsoft Word documents (.doc or .docx) with pig. Indeed, when i try to do so, by using TextLoader(), PigStorage() or no loader at all, it doesn't work. The output is some weird symbols.
I heard that I could write a custom loader in JAVA but it seems really difficult and I don't underdstand how we can program one of these at the moment.
I would like to put all the .doc file content in a single chararray bag so I could later use a filter function to process it.
How could I do ?
Thanks
They are right. Since .doc and .docx are binary formats, simple text loaders won't work. You can either write the UDF to be able to load the files directly into Pig, or you can do some preprocessing to convert all .doc and .docx files into .txt files so that Pig will be loading those .txt files instead. This link may help you get started in finding a way to convert the files.
However, I'd still recommend learning to write the UDF. Preprocessing the files is going to add significant overhead that can be avoided.
Update: Here are a couple of resources I've used for writing my java (Load) UDFs in the past. One, Two.

Resources