Artificial intelligent assistant

Exracting fields in file and storing it in different file in vim I have file int the following format: . . . Name:abc Occupation:def . . Name:xyz Occupation:ghi . . I want to extract the name and occupation field and save it in another file out.txt using `vim` in the following format: Name:abc Occupation:def Name:def Occupation:ghi EDIT:Occupation field position in input file updated

ggyG:e out.txtp:v/Name\|Occupation/d:w


Explanation


gg # Go to beginning of file
y # yank (copy)
G # to end of file
:e out.txt # Open a new file called out.txt
p # paste what you just copied
:v/Name\|Occupation/d # Delete all lines that don't contain Name or Occupation
:w # save

xcX3v84RxoQ-4GxG32940ukFUIEgYdPy 522e83a1a238a8fae16fca7a396c1abc