I have a text file and it has multiple interations of data as below. I need to extract selective data from each iteration and put it into a tibble/dataframe. I think I'll have to create some sort of a function that would be able to scan the data and place it into a relevant column. I have no idea how to do it and I have never dealt with this kind of data format. How can I do it?
Source file format
==============
Col1: X
objectClass: top
objectClass: Role
Col2: X1
Col2: X2
User: UserX
User: userY
User: UserZ
cn: P1
description: Permissions
Host: HRef456
Col1: Y
objectClass: top
objectClass: Role
Col2: Y3
Col2: Y4
Col2: Y5
User: U1
User: U2
cn: P2
description: Permissions
Host: HRef123
What I need:
===========
Error in readLines(file, skipNul = TRUE) : cannot open the connection In addition: Warning message: In readLines(file, skipNul = TRUE) : cannot open compressed file '63350291.txt', probable reason 'No such file or directory' – CT_369 Aug 11 '20 at 07:45