I think it is well known that SQL Developer can format SQL and even it's customizable.
» How to Make Your Code Look Like Steven Feuerstein’s in Oracle SQL Developer
ask SQL Developer to format your code,
I think lesser known is that this is possible with command line.
Here's a sample run on Solaris. I think /dev/stdin and /dev/stdout work on UNIXen.
~/sqldeveloper/sqldeveloper/bin$./sdcli format input=/dev/stdin output=/dev/stdout <<EOF> select col1,>> col2 , col3 from> TAB1> EOF Oracle SQL Developer Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. SELECT col1, col2 , col3 FROM TAB1
I apologize for NOT explaining the details. There are 2 reasons. Once I learn more, I will write another entry.
I downloaded SQLdeveloper from internal server. So, public version may behave a little differently.
I don't fully understand the feature. e.g.) How can I specify the formatting profile?