read csv files to vars

This commit is contained in:
olli 2024-06-18 22:47:36 +02:00
parent 8de696a9ce
commit 6f7bbfd2a7

View File

@ -64,9 +64,10 @@ function g_read_csv {
# put headlines to vars with reverse numbers (last line 0)
for g_headline_item in "${g_csv_headline_array[@]}"
do
declare -g v_${l}_${g_headline_item}="${g_csv_line_array[i]}"
#declare -g v_${l}_${g_headline_item}="${g_csv_line_array[i]}"
# last line to vars without number
[ "$l" = 0 ] && declare -g v_${g_headline_item}="${g_csv_line_array[i]}"
v_csv_array_associative[${g_headline_item}_${l}]="${g_csv_line_array[i]}"
((i++))
done
((l++))