Skip to content

Commit 732ca9b

Browse files
committed
code refactoring
1 parent c3a461e commit 732ca9b

File tree

1 file changed

+6
-12
lines changed

1 file changed

+6
-12
lines changed

sql_order.awk

+6-12
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,11 @@
11
# SQL order just want columns inside the brackets.
22
# Example: awk -f sql_order.awk files/ddl.sql
33

4-
BEGIN{f=1
5-
PROCINFO["sorted_in"] = "@ind_str_asc"
6-
}
7-
/^\(/{f=0
8-
print
9-
next
10-
}
11-
/^\)/{f=1
4+
BEGIN{PROCINFO["sorted_in"] = "@ind_str_asc"}
5+
/^\(/{f=1}
6+
/^\)/{f=0
127
for (i in a)
138
print a[i]
14-
delete a
15-
}
16-
!f{a[$1]=$0}
17-
f
9+
delete a}
10+
f{a[$1]=$0}
11+
!f

0 commit comments

Comments
 (0)