有一个日志文件为: # cat data.log 需要提取出里面的数据,写shell脚本实现这个功能: #!/bin/bash OLD=$IFS IFS=$'\n' for entry in $(cat /home/users/data.log) do echo "Values in $entry is" IFS=' ' for value in $entry: do echo " $value" done done IFS=OLD 其中IFS变一个环境变量,作为l
shell脚本能帮我们简化linux下的一些工作,现在有个需求,把TMPA文件夹下大于2000B的文件都移动到TMPB下 #! /bin/bash function movefiles() { ` do ] then mv $"/"$file fi done } movefiles "/home/jimmyxu/TMPA" "/home/jimmyxu/TMPB" 脚本很简单,使用for循环遍历第一个输入路径下的文件,使用stat获取文件的属性值
当我们出现这种情况时 FAILED: SemanticException [Error 10096]: Dynamic partition strict mode requires at least one static partition column. To turn this off set hive.exec.dynamic.partition.mode=nonstrict 这时候我们需要改变一下设置 set hive.exec.dynamici.partition=true;set h
insert into OPENROWSET('Microsoft.ACE.OLEDB.12.0','Excel 12.0;Database=C:\c.xlsx','select 字段1,字段2 FROM [sheet1$]') select 字段1,字段2 from table 今天单位一ASP.NET网站,里面有个功能是导出数据,发现一导出就报错,报错内容是:SQL Server 阻止了对组件 'Ad Hoc Distributed Queries' 的 STATEMENT'OpenRow
从sql中导出需要的数据为csv格式的数据 select field1,field2,...,fieldn from TABLE into outfile '/test.csv' fields terminated by ',' optionally enclosed by "" escaped by "" lines terminated by '\r\n'; 将test.csv数据导入到mongodb中,本人使用的是mongodb-3.2 mongoimport