我正在使用一个YAML文件,它有一个整数作为ID,每4-6行出现一次.我希望在此文件的中间添加一条记录(为了便于阅读),以保持顺序编号的完整性.
文件格式如下.有任何想法吗?
- id: 1
type: string
option: diff_string
other: alt_string // note: 'other' option does not appear for all records
- id: 2
type: string
option: diff_string
//new record would go here as id: 3, increasing id: # of all following records by 1
- id: 3
type: string
option: diff_string
other: alt_string
Run Code Online (Sandbox Code Playgroud)