I'm trying to convert a csv into a space-delimited string variable in bash and I'm having trouble figuring out how to get the info into a string.
How would I go about reading in and converting a csv that looks like this:
"number1 number2 number3 etc"
You can convert all newlines to spaces using
tr '\n' ' ' <file.csv
If you want to reuse the output, save in a variable:
out=$(tr '\n' ' ' <file.csv)
Now you can get the output string by using