I have a CSV file with two columns (and a header) where each of its elements includes any number between 0 to 199. I want to convert these to their corresponding URLs. Here is an example:
41,51
should become:
http://www.cs.bu.edu/~betke/research/vc-crowd/MSCOCO/41.jpg,http://www.cs.bu.edu/~betke/research/vc-crowd/MSCOCO/51.jpg
Here is the list.csv file I want to convert:
$ head list.csv
imageA,imageB
41,51
172,100
99,149
83,72
84,160
186,8
93,198
150,21
63,102
read
, see this SO answer. – dessert May 22 '18 at 19:56bash
Parameter Expansion, tryid=41,51;echo a${id/,/b,a}b
. – dessert May 22 '18 at 20:07read
withwhile
loop instead offor
::while IFS= read -r id; do echo "$id"; done < input-file
– pa4080 May 22 '18 at 20:19