I have used @PadLeft(@Format(%.3f,@Value(FLOW)), in an earlier attribute manager in the workspace to format the values to three decimal places and pad left. My output data and workspace are as shown below:
A CSV file uses a common delimiter to separate columns (usually a comma, can be any other char, in your case looks like a tab) and a new line to signify rows. Its purpose is to be machine readable, not necessarily human readable.
If you try to make it human readable by adding extra space etc, then you begin to change values and the schema of the file, for example, I have the below data, its comma separated and as you can see it doesn't line up
f1,f2,f3
value1,value2,value3
name,something a bit longer,date
But treating it as a csv, it correctly splits the field names into 'f1', 'f2', 'f3' and the rows into 'value1', 'value2' etc
However, if I now go and adjust it to make it look a bit nice to a human, I start to really change the data
f1, f2, f3
value1, value2, value3
name, something a bit longer, date
the first field name is fine, 'f1', however i've introduced a bunch of spaces into the field name for the second field, so that now reads as ' f2' (four spaces at the start). That is not the same as 'f2'. Similar goes for the third field (now has 21 spaces in front)
This also applies to the data rows, the second field in row 1 now reads as ' value2' (begins with one space). The second field of row 2 now reads as ' something a bit longer' (begins with two spaces).
If the data needs to be as CSV, then the best option is to not introduce any padding in an effort to 'format' the output, but to instead open the CSV in something like Excel where it conforms to a tabular structure
Yes, I used a tab in writing the CSV output. Thanks for your response!