read csv files to vars
This commit is contained in:
parent
79e55cd29d
commit
ad0ea9040b
@ -4,7 +4,7 @@ function g_read_csv {
|
|||||||
local g_headline=$3
|
local g_headline=$3
|
||||||
local g_separator=$4
|
local g_separator=$4
|
||||||
|
|
||||||
local g_headline_item i l r g_headline_item_varname
|
local g_headline_item i l r
|
||||||
|
|
||||||
# check for individual separator
|
# check for individual separator
|
||||||
[ -z "$g_separator" ] && g_separator=","
|
[ -z "$g_separator" ] && g_separator=","
|
||||||
@ -40,10 +40,7 @@ function g_read_csv {
|
|||||||
# prepare varnames from headline(s)
|
# prepare varnames from headline(s)
|
||||||
for g_headline_item in "${g_csv_headline_array_ref[@]}"
|
for g_headline_item in "${g_csv_headline_array_ref[@]}"
|
||||||
do
|
do
|
||||||
#g_csv_headline_array="${g_csv_headline_array_ref//[^a-zA-Z0-9]/}"
|
g_csv_headline_array+="${g_headline_item//[^a-zA-Z0-9]/}"
|
||||||
g_headline_item_varname="${g_headline_item//[^a-zA-Z0-9]/}"
|
|
||||||
echo "$g_headline_item_varname"
|
|
||||||
g_csv_headline_array+=("$g_headline_item_varname")
|
|
||||||
done
|
done
|
||||||
|
|
||||||
# read last lines if defined or complete csv file
|
# read last lines if defined or complete csv file
|
||||||
|
Loading…
Reference in New Issue
Block a user