super array v/vr

This commit is contained in:
olli 2024-08-24 13:16:37 +02:00
parent 2cdab60efb
commit 8d88743624

View File

@ -51,6 +51,7 @@ function g_read_csv {
g_basename $g_csvfile g_basename $g_csvfile
local g_csvfile_base=${g_basename_result/\.history*.csv/} local g_csvfile_base=${g_basename_result/\.history*.csv/}
g_csvfile_base=${g_csvfile_base//[^a-zA-Z0-9_]/} g_csvfile_base=${g_csvfile_base//[^a-zA-Z0-9_]/}
g_csvfile_base=${g_csvfile_base//ECONOMY*/}
# read last lines if defined or complete csv file # read last lines if defined or complete csv file
if [ -n "$g_last_lines" ] if [ -n "$g_last_lines" ]
@ -81,8 +82,14 @@ function g_read_csv {
[ "$l" = 0 ] && declare -g v_${g_headline_item}="${g_csv_line_array[i]}" [ "$l" = 0 ] && declare -g v_${g_headline_item}="${g_csv_line_array[i]}"
v_csv_array_associative[${g_headline_item}_${r}]="${g_csv_line_array[i]}" v_csv_array_associative[${g_headline_item}_${r}]="${g_csv_line_array[i]}"
v_csv_array_associative_reverse[${g_headline_item}_${l}]="${g_csv_line_array[i]}" v_csv_array_associative_reverse[${g_headline_item}_${l}]="${g_csv_line_array[i]}"
if [ -z "${g_csvfile_base}" ]
then
v[${g_headline_item}_${r}]=${g_csv_line_array[i]}
vr[${g_headline_item}_${l}]=${g_csv_line_array[i]}
else
v[${g_csvfile_base}_${g_headline_item}_${r}]=${g_csv_line_array[i]} v[${g_csvfile_base}_${g_headline_item}_${r}]=${g_csv_line_array[i]}
vr[${g_csvfile_base}_${g_headline_item}_${l}]=${g_csv_line_array[i]} vr[${g_csvfile_base}_${g_headline_item}_${l}]=${g_csv_line_array[i]}
fi
((i++)) ((i++))
done done
((l++)) ((l++))