File tree Expand file tree Collapse file tree 6 files changed +84
-11
lines changed Expand file tree Collapse file tree 6 files changed +84
-11
lines changed Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+ INPUT=
3
+ if [ ! -t 0 ]; then
4
+ IFS=' ' read -d ' ' -r INPUT
5
+ echo -n " ${INPUT} "
6
+ fi
7
+ if [ ! -z " $1 " ]; then
8
+ params=(" $@ " )
9
+ for i in " ${params[@]} " ; do
10
+ echo -n " $i "
11
+ done
12
+ fi
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+ INPUT=
3
+ if [ ! -t 0 ]; then
4
+ IFS=' ' read -d ' ' -r INPUT
5
+ echo -n " ${INPUT} "
6
+ fi
7
+ if [ ! -z " $1 " ]; then
8
+ # Script to split a string based on the delimiter
9
+ if [ -r " $1 " ]; then
10
+ header=$( head -n 1 $1 )
11
+ params=($( echo $header | tr " ," " \n" ) )
12
+ # Print the split string
13
+ [ ! -z " $2 " ] && [ ! -r " $2 " ] && echo -n " " > $2
14
+ for i in " ${params[@]} "
15
+ do
16
+ echo $i
17
+ [ -r " $2 " ] && echo $i >> $2
18
+ # echo -n "$i"
19
+ done
20
+ fi
21
+ fi
Original file line number Diff line number Diff line change
1
+ PATH,PRICE,CURRENCY
2
+ Faktura_FP_676_1_2020.pdf,2.74,EUR
3
+ RG_100067031335.pdf,0.84,EUR
Original file line number Diff line number Diff line change 1
1
#! /bin/bash
2
- # # prepare example of file: index.html
3
- curl " https://softreck.com" --silent -o index.html
2
+ # CONTRIBUTION
3
+ # # Author: Tom Sapletta
4
+ # # Created Date: 25.07.2022
5
+
4
6
echo " "
7
+ if [ -z " $1 " ]; then
8
+ ls -1 test/
9
+ exit
10
+ fi
5
11
6
- # # Test
12
+ testFile () {
13
+ echo $1
14
+ echo " # TEST"
15
+ echo " FILE: $1 "
16
+ cat test/$1
17
+ echo " "
18
+ echo " OUTPUT:"
19
+ sh test/$1
20
+ echo " "
21
+ }
22
+ # # Test One
23
+ if [ -r " test/$1 " ]; then
24
+ testFile $1
25
+ exit
26
+ fi
27
+ # # Test ALL
7
28
TEST_FILE_LIST=$( ls test)
8
29
for FILE in $TEST_FILE_LIST
9
30
do
10
- echo " # TEST"
11
- echo " FILE: $FILE "
12
- cat test/$FILE
13
- echo " "
14
- echo " OUTPUT:"
15
- sh test/$FILE
16
- echo " "
17
- done
31
+ testFile $FILE
32
+ done
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+ ./fileToSqliteTable.sh " test.csv" " Tablename" " db.sqlite"
3
+ ./fileAsTableOnSqlite.sh " test.csv" " Tablename" " db.sqlite"
4
+ ./csvFileAsTableOnSqlite.sh " test.csv" " Tablename" " db.sqlite"
5
+ ./mapCsvFileTOSqlite.sh " map.csv" " test.csv" " db.sqlite"
6
+
7
+
8
+ CSV_COL,SQL_COLUMN,TYPE
9
+
10
+
11
+
12
+ SOURCE_COL,TARGET_COL
13
+
14
+ TARGET_COL, TARGET_TYPE
15
+
16
+
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+ ./labelsToLines.sh " test.csv" " header.txt"
3
+
4
+
5
+
6
+
You can’t perform that action at this time.
0 commit comments