Advertisement
hakonhagland

gawk-sed

Jan 11th, 2014
285
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. Here is the command:
  2.  
  3. awk '{gsub(/\n\n+/,"\n\n");printf $0}' RS="^$" $1 | sed '
  4. s/\s*\([.,;!?]\)\s*/\1 /g
  5. s/\s\+/ /g
  6. s/^.*$/\L&/
  7. s/\([.;!?]\s*\)\(.\)/\1\u\2/g
  8. s/^./\u&/
  9. /\(^$\)\|\([!?;.,]\s*$\)/! s/\s*$/.&/ #C3
  10.  
  11. And here is the output:
  12.  
  13. I need to go to london, after i reach the; Uk.
  14.  
  15. But i need five hours? To reach it.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement