例如,我有一个文件:
$ cat file
i am the first example.
i am the second line.
i do a question about a file.
Run Code Online (Sandbox Code Playgroud)
我需要:
example, line, file
Run Code Online (Sandbox Code Playgroud)
我的意图是"awk",但问题是这些单词在不同的空间
例如,我需要按日期范围更改一年中的周数
我在2013年的第46周
日期范围是:
2013-11-11
2013-11-12
2013-11-13
2013-11-14
2013-11-15
2013-11-16
2013-11-17
Run Code Online (Sandbox Code Playgroud)
我不知道我能用bash做到这一点
该数字是脚本的参数,例如,如果脚本调用您使用的convertir.sh
convertir.sh 2013 46
Run Code Online (Sandbox Code Playgroud)
其中2013年是一年,46是一年中的一周,脚本的输出是日期范围
我在mysql中有3个表
table 1
date name total recieve
2013-05-09 "aa" 20 15
2013-05-09 "bb" 10 17
table 2
name tree
"bb" "a1"
"aa" "a2"
table 3
date tree users
2013-05-09 "a1SI" 19
2013-05-09 "a1NO" 24
2013-05-09 "a2SI" 39
2013-05-09 "a2NO" 22
Run Code Online (Sandbox Code Playgroud)
我需要一个树表的视图
这是我需要的观点:
date name tree total recieve userSI userNO
2013-05-09 "aa" "a2" 20 15 39 22
2013-05-09 "bb" "a1" 10 17 19 24
Run Code Online (Sandbox Code Playgroud)
我有一半的查询
SELECT t1.`date` , t1.`name` , t2.`tree` , t1.`total` , t1.`recieve`,
FROM `table1` t1
INNER JOIN `table2` …Run Code Online (Sandbox Code Playgroud)