Created
October 8, 2015 17:01
-
-
Save Phrozyn/002f9f121fb982eb1e70 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Remove enclosing brackets | |
sed -i 's/\(\[\|\]\)//g' $file | |
Add a new line after closing brace and comma | |
sed -i 's/\}\,/}\,\n/g' $file | |
Add index with type | |
sed -i 's/{/{"index":{"_index":"<index_name>","_type":"<type>"}}\n{/g' $file | |
Replace all spaces between two words with underscores | |
sed -i -e 's/\(\w\)\s\(\w\)/\1_\2/g' $file | |
Add a new line at the end of the file | |
sed -i -e '$a\' $file |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment