I am unsatisfied with the discussion here, so am opening a new thread to find a solution to this.
In Python, it is quite simple to save a data frame or dictionary with fixed width columns as a
.dat file. This usability does not seem to exist in Julia. What is the simplest method possibly (ideally avoiding some obscure package) to construct variable size delimiters for saving human readable .dat files?
To give a minimal working example of most of what I am hoping for
using DelimitedFiles, DataFrames inputfile = "/home/local_directory_example/inputfile.json" outputfile = "/home/local_directory_example/output_directory/" # some dictionary that will get created d = Dict("ALPHA TEST" => [5.240,1.2340,23.445625633676,4.30,5.2340], "B" => [4.235,3.0,2.245,5.245,1.245]) df = DataFrame(d) fobj = open(inputfile ,"r") input_file_contents = read(fobj, String) fobj2=open(filename*"_test.dat", "w") write(fobj2, input_file_contents) writedlm(fobj2,Iterators.flatten(([names(df)], eachrow(df)))) close(fobj) close(fobj2)
This creates a header in my .dat file with my input file and saves the output data but the formatting is unsightly.