Reputation: 1
One row of data looks like
"!Next?" (1994) Italy
I need to create 3 columns.
""
()
I need to specify different delimiter for each column.
One IMPORTANT thing - I am loading data from file /home/ap/Downloads/country.list
It would be great if could explain a little bit of query along.
Thanks in advance...
Upvotes: 0
Views: 230
Reputation: 2223
use this cmd
cat YOUR_FILE_HERE|sed 's/"\(.*\)"\s*(\(.*\))\s*\([^\s].*\)/\1^A\2^A\3/g' > OUTPUT_FILE
then load this OUTPUT_FILE to your hive table.
REMEMBER:
I use \001
as delimiter here.If you change the table default fields terminater, use that to replace the ^A
in my cmd.
And also the ^A
is input by ctrl-v
and then ctrl-a
not the ^
and A
.
Upvotes: 0