I have a YAML file for example `resource.yaml`.
I want to find in this file all the lines ( actually it should be only one
), with the following string: "resource_type: apple" and immediately after that line add the following lines:
```
color: red
weight: '1 kg'
origin: "Country x"
```
Hello community,
I have a YAML file for example `resource.yaml`.
I want to find in this file all the lines ( actually it should be
only one ), with the following string: "resource_type: apple" and
immediately after that line add the following lines:
```
color: red
weight: '1 kg'
origin: "Country x"
```
The result should be:
```
resource_type:
color: red
weight: '1 kg'
origin: "Country x"
```
Any advice using awk, sed or something else ?
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 546 |
Nodes: | 16 (2 / 14) |
Uptime: | 53:12:58 |
Calls: | 10,397 |
Calls today: | 5 |
Files: | 14,067 |
Messages: | 6,417,394 |
Posted today: | 1 |