-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsimple-awk-and-sed.html
147 lines (116 loc) · 5.26 KB
/
simple-awk-and-sed.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
<!DOCTYPE html>
<html lang="en" prefix="og: http://ogp.me/ns# fb: https://www.facebook.com/2008/fbml">
<head>
<title>simple awk and sed - Yi Yao's Homepage</title>
<!-- Using the latest rendering mode for IE -->
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="canonical" href="./simple-awk-and-sed.html">
<meta name="author" content="Yi Yao" />
<meta name="keywords" content="awk,sed" />
<meta name="description" content="the simple use of awk and sed" />
<meta property="og:site_name" content="Yi Yao's Homepage" />
<meta property="og:type" content="article"/>
<meta property="og:title" content="simple awk and sed"/>
<meta property="og:url" content="./simple-awk-and-sed.html"/>
<meta property="og:description" content="the simple use of awk and sed"/>
<meta property="article:published_time" content="2014-12-24" />
<meta property="article:section" content="misc" />
<meta property="article:tag" content="awk" />
<meta property="article:tag" content="sed" />
<meta property="article:author" content="Yi Yao" />
<!-- Bootstrap -->
<link rel="stylesheet" href="./themestatic/css/bootstrap.min.css" type="text/css"/>
<link href="./themestatic/css/font-awesome.min.css" rel="stylesheet">
<link href="./themestatic/css/pygments/native.css" rel="stylesheet">
<link rel="stylesheet" href="./themestatic/css/style.css" type="text/css"/>
</head>
<body>
<div class="navbar navbar-default navbar-fixed-top" role="navigation">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-ex1-collapse">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a href="./" class="navbar-brand">
Yi Yao's Homepage </a>
</div>
<div class="collapse navbar-collapse navbar-ex1-collapse">
<ul class="nav navbar-nav">
<li><a href="index.html">About Me</a></li>
<li><a href="research.html">Research</a></li>
<li><a href="categories.html">Research Blogs</a></li>
</ul>
<ul class="nav navbar-nav navbar-right">
</ul>
</div>
<!-- /.navbar-collapse -->
</div>
</div> <!-- /.navbar -->
<!-- Banner -->
<!-- End Banner -->
<!-- Content Container -->
<div class="container">
<div class="row">
<div class="col-lg-12">
<section id="content">
<article>
<header class="page-header">
<h1>
<a href="./simple-awk-and-sed.html"
rel="bookmark"
title="Permalink to simple awk and sed">
simple awk and sed
</a>
</h1>
</header>
<div class="entry-content">
<div class="panel">
<div class="panel-body">
<footer class="post-info">
<span class="label label-default">Date</span>
<span class="published">
<i class="fa fa-calendar"></i><time datetime="2014-12-24T01:56:00+01:00"> Wed 24 December 2014</time>
</span>
<span class="label label-default">Tags</span>
<a href="./tag/awk.html">awk</a>
/
<a href="./tag/sed.html">sed</a>
</footer><!-- /.post-info --> </div>
</div>
<p>awk and sed are two powerful command line tools for text processing. The only usage I will use are these two. For all the other complicated tasks I would prefer to use python.</p>
<div class="highlight"><pre><span></span><code>awk '{print $1 " " $2 " " $3}' input > output
sed 's/wrong/right/' input > output
sed "/&word_after_which_to_insert/ r file_insert" template.inp > out.inp
</code></pre></div>
</div>
<!-- /.entry-content -->
</article>
</section>
</div>
</div>
</div>
<!-- End Content Container -->
<footer>
<div class="container">
<hr>
<div class="row">
<div class="col-xs-10">© 2021 Yi Yao
· Powered by <a href="https://github.com/getpelican/pelican-themes/tree/master/pelican-bootstrap3" target="_blank">pelican-bootstrap3</a>,
<a href="http://docs.getpelican.com/" target="_blank">Pelican</a>,
<a href="http://getbootstrap.com" target="_blank">Bootstrap</a> </div>
<div class="col-xs-2"><p class="pull-right"><i class="fa fa-arrow-up"></i> <a href="#">Back to top</a></p></div>
</div>
</div>
</footer>
<script src="./themestatic/js/jquery.min.js"></script>
<!-- Include all compiled plugins (below), or include individual files as needed -->
<script src="./themestatic/js/bootstrap.min.js"></script>
<!-- Enable responsive features in IE8 with Respond.js (https://github.com/scottjehl/Respond) -->
<script src="./themestatic/js/respond.min.js"></script>
</body>
</html>