File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -547,15 +547,21 @@ iterate() (
547
547
# _______________________________________________________________________
548
548
# |__ CSV ____________________________________________________________|
549
549
#
550
- # csv
550
+ # csv [-d delimiter] [-D line-delimiter]
551
551
#
552
552
# Parse a line of input and write the CSV fields to the CSVLINE array.
553
553
#
554
554
csvline () {
555
555
CSVLINE=()
556
- local line field quoted=0 delimiter=,
556
+ local line field quoted=0 delimiter=, lineDelimiter=$' \n ' c
557
+ local OPTIND=1
558
+ while getopts :d: arg; do
559
+ case $arg in
560
+ d) delimiter=$OPTARG ;;
561
+ esac
562
+ done
557
563
558
- IFS= read -r line || return
564
+ IFS= read -d " $lineDelimiter " - r line || return
559
565
while IFS= read -rn1 c; do
560
566
case $c in
561
567
\" )
You can’t perform that action at this time.
0 commit comments