alpha
Login
or
Join now
xcc.es
/
dotfiles
Star
0
Fork
0
Atom
Configure Feed
Issues
Pull Requests
Commits
Tags
Feed URL
Select the types of activity you want to include in your feed.
[READ-ONLY] Mirror of https://github.com/mrgnw/dotfiles. My shell customizations - aliases, functions, and themes.
dotfiles
shell
zinit
zsh
Star
0
Fork
0
Atom
Configure Feed
Issues
Pull Requests
Commits
Tags
Feed URL
Select the types of activity you want to include in your feed.
Overview
Issues
Pulls
Pipelines
Update data.zsh
author
Morgan
date
2 years ago
(May 19, 2024, 9:15 PM +0200)
commit
df3bcd7f
df3bcd7f0d4c73f896a17d12fd03d7e929e74971
parent
aec1d78d
aec1d78dad26a8033955d7f478a684cf1304cca2
-43
1 changed file
Expand all
Collapse all
Unified
Split
data.zsh
-43
data.zsh
View file
Reviewed
···
1
1
alias duck='duckdb'
2
2
3
3
-
4
3
jsonl(){
5
4
local selector="${2:-.[]}"
6
5
jq -c "$selector" "$1" > "$1:r".jsonl
7
6
}
8
8
-
9
9
-
sojsonl(){ jsonl "$1" ".[].row[]" }
10
10
-
sojsons(){
11
11
-
for f in **/*.json; do
12
12
-
sojsonl "$f"
13
13
-
done
14
14
-
}
15
15
-
16
16
-
# dasf file [new_ext]
17
17
-
dasf(){
18
18
-
new_ext="${2:-json}"
19
19
-
dasel -f "$1" -r "$1:e" -w "$new_ext" > "$1:r"."$new_ext"
20
20
-
}
21
21
-
22
22
-
dasf2(){
23
23
-
echo "$1" > "$1:r".json
24
24
-
dasel -f "$1" -r "$1:e" -w "json" | jj -u > "$1:r".json
25
25
-
}
26
26
-
27
27
-
dasfs(){
28
28
-
for f in **/*.xml; do
29
29
-
echo "$f" > "$f:r".json
30
30
-
dasel -f "$f" -r "$f:e" -w "json" | jj -u > "$f:r".json
31
31
-
done
32
32
-
}
33
33
-
34
34
-
xls(){
35
35
-
# if there's one argument, convert it to csv
36
36
-
if [[ $# -gt 0 ]]; then
37
37
-
echo "» $1"
38
38
-
xlsx2csv $1 $1:t:r -s 0
39
39
-
else
40
40
-
for xl in *.xlsx; do
41
41
-
echo "» xl"
42
42
-
xlsx2csv $xl $xl:t:r -s 0
43
43
-
echo "Converted $xl to csvs in folder $xl:t:r"
44
44
-
trash $xl
45
45
-
done
46
46
-
fi
47
47
-
}
48
48
-
49
49
-
alias csv='xls'