02-07-2012 01:26 PM
Hey guys,
I know that there has to have been a post on this, but I can seem to find it. I have several (11) DBLs which need to be formatted differently (some are dates MMDDYY, some are values 0.5555) then written to a file. I using <Array to Spreadsheet String> and <Write to Text File> which is why I need to format it. Here's the format specifier syntax I'm using:
%8.0f %4.0f %5.0f %3.1f %5.2f %4.2f %3.1f %3.1f %3.1f %4.4f %3.2f
When I open the file, this syntax follows every value (and they aren't formatted). I'm hoping there is a glaring mistake that can be easily fixed!
(PS I've tried every different delimiter to no avail)
Cheers,
Tyler
Solved! Go to Solution.
02-07-2012 01:35 PM
Hang on to your current code until this idea is (eventually) implemented:
In the meantime you are going to have to individually format the columns to have different formats.
02-07-2012 01:40 PM
It would help if you upload your code to be certain that we understand what you're doing. If that is the format string you're passing to "Array to Spreadsheet String" then I think I see the problem - you can only pass a single format specifier to that function, and every value is formatted identically. Any unused format specifiers are treated as normal text which is why they're showing up in your file. Unfortunately you need to do a bit more work to make this work right. One option is to separate out the columns, format them into strings, recombine the columns into an array of strings, and then write that out with "%s" as the format specifier for Array to Spreadsheet String. Another possibility is to use Format Into String and index out the array elements.
02-07-2012 01:42 PM
Thanks Darin, I'll give that a try. Nathan, I had built an array then tried to format. Seems like this will be an easy fix. Format then build the array, the write to text.
Cheers,
Tyler