ark1320 Posted June 25, 2019 Report Posted June 25, 2019 Hi Pete, I can't seem to find how to specify the formatting of string variables for a CSV file using, I assume, the newline \n character. I know how to do it with numerical variables, but am not having any luck with string variables. For example, using something like file:write(string.format("%-3s %-6s %-5s ", str_var1, \n str_var2, \n str_var3 \n )) I want to end up with the value of each string variable on a separate line in the CSV file but can't seem to get the syntax correct. Thanks for any suggestions, Al
John Dowson Posted June 26, 2019 Report Posted June 26, 2019 The newlines go in the format string, so something like string.format("%-3s\n%-6s\n%-5s ", str_var1, str_var2, str_var3)
ark1320 Posted June 26, 2019 Author Report Posted June 26, 2019 4 hours ago, John Dowson said: The newlines go in the format string, so something like string.format("%-3s\n%-6s\n%-5s ", str_var1, str_var2, str_var3) Makes sense, thanks! Al
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now