infobright

load data local infile '/tmp/a.txt' into table UserInfo  CHARACTER SET utf8 fields terminated by '\t';

 

#!/bin/bash
dbuser='root'
dbpasswd='@321'
mysql-ib -u$dbuser -p$dbpasswd << EOF >> /dev/null
use gwdb;
drop table if exists jf_0001;

/*==============================================================*/
/* Table: jf_0001                                      */
/*==============================================================*/
create table jf_0001
(
   BASE_CODE            char(32) not null,
   AREA_CODE            char(32),
   BASE_LGTUDE          float,
   BASE_LTTUDE          float,
   BASE_SAFECODE        char(32),
   BASE_NAME            char(128),
   BASE_TYPE            char(128),
   BASE_NAT             char(128),
   BASE_FUSR            char(64),
   BASE_UTYPE           char(32),
   BASE_USERNO          char(128),
   BASE_TYPENO          char(128),
   BASE_STIME           datetime,
   BASE_ETIME           datetime,
   BASE_NETTYPE         char(128),
   BASE_SINFO           char(128),
   BASE_NO              char(128),
   BASE_ISOPEN          char(128),
   BASE_ADRESS          char(255),
   BASE_USR             char(32),
   BASE_U_TEL           char(32),
   BASE_U_SUSR          char(32),
   BASE_SU_TEL          char(32),
   BASE_SU_EMAIL        char(128),
   BASE_SU_NUM          char(32),
   BASE_SNAME           char(64),
   BASE_ITYPE           char(32),
   BASE_UNO             int,
   BASE_WJ              char(128),
   BASE_WJUSER          char(128),
   BASE_WJ_TEL          char(32),
   BASE_POLICE          char(32),
   BASE_PUSER           char(12),
   BASE_MARK            varchar(256),
   BASE_PSW             char(128),
   BASE_RPSW            char(128),
   outFlag              char(24),
   time                 datetime
);
show databases;
show tables;
exit
EOF

 

cat new_httprequestinfo.txt |awk -F '\t' '{print $1,"\t"0,"\t"$2,"\t"$3,"\t"$4,"\t"$5,"\t"$6,"\t"$7,"\t"$8,"\t"$9,"\t"$10,"\t"$11,"\t"$12}'>new_httprequestinfo.log

  

替换zhidao.txt文件中所有的双引号为空格
sed -i 's/"//g' a.txt

 

cat /MarkNum/FtpDataBase/omac/2015-12-25/3703032B000001-151224040412.txt|awk '{print $2"|"$1"|"$3}'|sort -n|uniq -w 17

 

url.sh

#!/bin/bash
cd /tmp
fileName=gw_httpRequest_37030220000003_20151230201337.log
codeBase=37000000000001
cat "$fileName"|awk -F "\t" 'NF=10{"date -d \""$1"\" +\"%F %T\""|getline time;print 0"\t"0"\t"time"\t"$2"\t"$3"\t"$4"\t"$5"\t"$6"\t"$7"\t"$8"\t"$9"\t"$10"\t"'$codeBase';close("date -d \""$1"\" +\"%F %T\"")}'>>/tmp/url.log

loadurl.sh

#!/bin/bash
mysql-ib -uroot -p321 << EOF
use gwdb;
load data local infile '/tmp/url.log' into table open_url  CHARACTER SET utf8 fields terminated by '\t';
exit;
EOF

wa_basic_jf_0001.sh
#!/bin/bash
rm -rf /tmp/wa_basic_jf_0001.txt
mysql -uroot -@321 << EOF
use marknumzbdatabase;
select * from wa_basic_jf_0001 into outfile '/tmp/wa_basic_jf_0001.txt';
exit;
EOF
dbuser='root'
dbpasswd=321'
mysql-ib -u$dbuser -p$dbpasswd << EOF
use gwdb;
drop table if exists wa_basic_jf_0001;
/*==============================================================*/
/* Table: wa_basic_jf_0001                                      */
/*==============================================================*/
create table wa_basic_jf_0001
(
   BASE_CODE            char(32) not null,
   AREA_CODE            char(32),
   BASE_LGTUDE          float,
   BASE_LTTUDE          float,
   BASE_SAFECODE        char(32),
   BASE_NAME            char(128),
   BASE_TYPE            char(128),
   BASE_NAT             char(128),
   BASE_FUSR            char(64),
   BASE_UTYPE           char(32),
   BASE_USERNO          char(128),
   BASE_TYPENO          char(128),
   BASE_STIME           datetime,
   BASE_ETIME           datetime,
   BASE_NETTYPE         char(128),
   BASE_SINFO           char(128),
   BASE_NO              char(128),
   BASE_ISOPEN          char(128),
   BASE_ADRESS          char(255),
   BASE_USR             char(32),
   BASE_U_TEL           char(32),
   BASE_U_SUSR          char(32),
   BASE_SU_TEL          char(32),
   BASE_SU_EMAIL        char(128),
   BASE_SU_NUM          char(32),
   BASE_SNAME           char(64),
   BASE_ITYPE           char(32),
   BASE_UNO             int,
   BASE_WJ              char(128),
   BASE_WJUSER          char(128),
   BASE_WJ_TEL          char(32),
   BASE_POLICE          char(32),
   BASE_PUSER           char(12),
   BASE_MARK            varchar(256),
   BASE_PSW             char(128),
   BASE_RPSW            char(128),
   outFlag              char(24),
   time                 datetime
);
load data local infile '/tmp/wa_basic_jf_0001.txt' into table wa_basic_jf_0001  CHARACTER SET utf8 fields terminated by '\t';
exit;
EOF

 

 

 

 

 

 

你可能感兴趣的:(大数据)