我试图将数据从HBase Shell导出到我可以解析的文本文件,并添加到msysql数据库.
我目前正在使用以下命令:
echo "scan 'registration',{COLUMNS=>'registration:status'}" | hbase shell > registration.txt
Run Code Online (Sandbox Code Playgroud)
它导出从hbase shell到registration.txt的所有内容.
如何删除shell简介和摘要,只需将数据行附加到文本文件中:
例如:Shell我想省略:
HBase Shell; enter 'help<RETURN>' for list of supported commands.
Type "exit<RETURN>" to leave the HBase Shell
Version 0.94.5-mapr, Wed May 1 7:42:07 PDT 2013
Run Code Online (Sandbox Code Playgroud)
总结我想省略:
ROW COLUMN+CELL
4419 row(s) in 12.9840 seconds
Run Code Online (Sandbox Code Playgroud)
小智 10
试试这个
echo "scan 'registration',{COLUMNS=>'registration:status'}" | hbase shell | grep "^ " > registration.txt
Run Code Online (Sandbox Code Playgroud)
由于结果以单个空格为前缀,因此剩余的内容将被过滤掉.