基本上我需要打印2行然后删除两行,依此类推.
awk 'BEGIN {count = 0} if(count == 4){count = 0} else if(count <= 1) {print,count++} else {count++}' f4
Run Code Online (Sandbox Code Playgroud)
我收到语法错误.
要么
awk '{count = 0; if(count == 4)count = 0; else if(count <= 1) print count++; else count++;}' f4
Run Code Online (Sandbox Code Playgroud)
它打印全部为零.
我也试过了
awk 'NR%3 && NR%4' f4
Run Code Online (Sandbox Code Playgroud)
这是接近但3和4的倍数不打印.
谢谢
编辑:GOT IT!
awk 'BEGIN{count = 0};{ if(count == 3)count = 0; else if(count <= 1) {print; count=count+1;} else count=count+1;}' f4
Run Code Online (Sandbox Code Playgroud) 我无法让Javascript工作.这三个都在同一个文件夹中.Chrome也需要一段时间才能打开,但Firefox是即时的.谢谢.
我的HTML:
<html>
<head>
<title></title>
<link rel='stylesheet' type='text/css' href='stylesheet.css'/>
<script type='text/javascript' src='script.js'></script>
<script src="//ajax.googleapis.com/ajax/libs/jqueryui/1.9.1/jquery-ui.min.js"></script>
</head>
<body>
<div>Hover Over Me!</div>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)
我的CSS:
div {
height: 100px;
background-color: #ABCDEF;
font-family: Verdana, Arial, Sans-Serif;
font-size: 1em;
text-align: center;
}
Run Code Online (Sandbox Code Playgroud)
我的Javascript:
$(document).ready(function(){
$('div').mouseenter(function(){
$(this).fadeTo(1000, 1);
});
$('div').mouseleave(function(){
$(this).fadeTo(1000, .25);
});
Run Code Online (Sandbox Code Playgroud)