Here is a snippet of data I have to analyze:
2014 log[1]: id="1" sys="Sec" sub="fill" severity="inf" dort="30"
2014 log[2]: id="2" sys="Sec" sub="fill" severity="inf" name="dropped"
Excuse me if this is an obvious question, but what kind of data is this, and how can I get it into a csv format to analyze? So far I have tried using R by specifying whitespace as the delimiter, but that didn't get me what I need:
table1<-read.table('data.txt', sep="", fill=TRUE, header = FALSE)
Ideally, "id", "sys", "sub", "severity", "dort"
, and "name"
would be the column headers. Each row contains about the same number of variables, but some rows do not contain variables that other rows do. For those instances, I would like there to be "NULL". Ex: In row two in the data above, under the dort
column I would like it to say "NULL"
Hope this helps!
Let's consider that
test.txt
has above mentioned data thenOutput is: