temp.txt The problem that I am experiencing is that the elements are being written horizontally in the file. (jq 1.5 has a similar filter, @tsv, for generating tab-separated-value files.) I want them written... (5 Replies) RIP Tutorial. For this reason we add the flag -r to jq which drops one set of quotes. Now you can access the array to get any word you desire or use the for loop in bash to print all the words one by one as I have done in the above script. Get code examples like "split string to array bash" instantly right from your google search results with the Grepper Chrome Extension. Read csv delimited file line1 and store all values in array 2. Without -r bash interprets the backslash as a quoting character using it to group 'foo bar' as a single word. It seems most of the solutions expect the JSON to be a single object rather than an array of objects. cat file.csv | while read line; do line=( ${line//,/ } ) echo "0: ${line[0]}, 1: ${line[1]}, all: ${line[@]}" done The echo line is just an example of doing things. This has proven to be fairly difficult. Unlike in many other programming languages, in bash, an array is not a collection of similar elements. share ... create array $(Fiberon Brown Railing, Epsom Salts Bulk Buy, Site For Sale Ballyconneely, Faith Academy Manila Address, Kohler Cimarron Toilet Lowe's, Discuss The Composition And Variety Of Tooth Whitening Products, " />
Go to Top