【发布时间】:2023-03-20 10:50:01
【问题描述】:
我在文本文件中有以下数据
INSTANCES machine1
Name Berlin
Role NA
INSTANCES machine2
Name London
Role NA
INSTANCES machine3
Role parser
Name Dublin
INSTANCES machine4
Name Madrid
INSTANCES machine5
Role parser
Name Lisbon
我需要创建以下输出。我该怎么做
machine1 Berlin NA
machine2 London NA
machine3 Dublin parser
machine4 Madrid NONE
machine5 Lisbon parser
【问题讨论】:
-
使用 Linux 上可用的许多程序中的任何一种。您可能已经安装了 awk、sed 和 perl。这些可用于基本的文本操作。
-
processing 标签只能用于处理语言相关的问题。