2018-11-16 16:22:39 +00:00
|
|
|
---
|
|
|
|
layout: page
|
|
|
|
author: Domenico Votta
|
|
|
|
category-page: advanced
|
|
|
|
category-title: Advanced commands
|
|
|
|
tags: remove column
|
|
|
|
title: colrm
|
|
|
|
---
|
2018-11-16 19:47:01 +00:00
|
|
|
The <code>colrm</code> is a command that removes the column that you indicate <br>
|
2018-11-16 16:22:39 +00:00
|
|
|
|
|
|
|
Here we have a file named <code>example.txt</code> that contains two lines to test this command:<br>
|
|
|
|
|
|
|
|
{% highlight bash linenos %}
|
|
|
|
123456789
|
|
|
|
abcdefghi
|
|
|
|
{% endhighlight %}
|
|
|
|
|
|
|
|
The syntax command is:
|
2018-11-16 19:47:01 +00:00
|
|
|
<pre>
|
|
|
|
colrm [first] [last]
|
|
|
|
</pre>
|
2018-11-16 16:22:39 +00:00
|
|
|
|
|
|
|
<pre>
|
2018-11-16 19:47:01 +00:00
|
|
|
colrm 4 < example.txt
|
|
|
|
123
|
|
|
|
abc
|
2018-11-16 16:22:39 +00:00
|
|
|
</pre>
|
2018-11-16 19:47:01 +00:00
|
|
|
|
|
|
|
How you can see, if I don't indicate the last column, the command removes
|
|
|
|
all the colums starting from 4 included.
|
2018-11-16 16:22:39 +00:00
|
|
|
<pre>
|
2018-11-16 19:47:01 +00:00
|
|
|
colrm 2 4 < example.txt
|
|
|
|
156789
|
|
|
|
aefghi
|
2018-11-16 16:22:39 +00:00
|
|
|
</pre>
|
2018-11-16 19:47:01 +00:00
|
|
|
|
|
|
|
Here, how you can see, the command has removed not all the columns, but only the colums that
|
|
|
|
starting at 2 and ending at 4, included.
|