Skip to content

Commit f49c07b

Browse files
authored
Create json-split1.sh
1 parent 7a31f03 commit f49c07b

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

json-split1.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
http://stackoverflow.com/questions/1955505/parsing-json-with-unix-tools
2+
cat filename.txt| sed -e 's/[{}]/''/g' | awk '{n=split($0,a,","); for (i=1; i<=n; i++) print a[i]}'
3+
4+
Same code with a filter k="text" to show only fields with name "text" (but this filter is not working)
5+
cat filename.txt | sed -e 's/[{}]/''/g' | awk -v k="text" '{n=split($0,a,","); for (i=1; i<=n; i++) print a[i]}'
6+

0 commit comments

Comments
 (0)