连接/合并列

时间:2015-05-29 02:50:04

标签: awk sed concatenation

文件(约50,000列)

Podfile

输出

ObjectAL-for-iPhone (~> 2.5)

我基本上想要从column4开始将每两列连接成一列。我们怎么能用awk或sed做呢?

1 个答案:

答案 0 :(得分:1)

有可能在awk中。见下文

mysql> describe service_types;
+-------------+--------------+------+-----+---------+----------------+
| Field       | Type         | Null | Key | Default | Extra          |
+-------------+--------------+------+-----+---------+----------------+
| id          | int(11)      | NO   | PRI | NULL    | auto_increment |
| name        | varchar(255) | YES  |     | NULL    |                |
| description | varchar(255) | YES  |     | NULL    |                |
| time        | varchar(255) | YES  |     | NULL    |                |
| price       | decimal(8,2) | YES  |     | NULL    |                |
| decimal     | decimal(8,2) | YES  |     | NULL    |                |
| service_id  | int(11)      | YES  | MUL | NULL    |                |
| created_at  | datetime     | NO   |     | NULL    |                |
| updated_at  | datetime     | NO   |     | NULL    |                |
+-------------+--------------+------+-----+---------+----------------+

很抱歉只是注意到你给了两行作为例子......

service_id