1

I have an event file which is coming from external power analyzer device's SD card. When I try to open this file via Windows Event Viewer I am getting following error message;

enter image description here

When I try to open it via Notepad it seems its encoded, enter image description here

In R, I tried all 652 encoding types to get the decoded version but non of them worked. I used the code below;

options(stringsAsFactors = FALSE)
txt = readtext("file_path")[1,2]

library(stringi)
stri_enc_mark(txt)
list_of_encodings=stri_trans_list()
encoded_texts = data.frame(matrix(data = "",nrow=length(list_of_encodings),ncol=2))
encoded_texts = `colnames<-`(encoded_texts,c("encoding","encoded_text"))
encoded_texts$encoding=list_of_encodings

for(i in 1:nrow(encoded_texts)){
  encoded_texts[i,"encoded_text"]=stri_trans_general(txt, encoded_texts[i,"encoding"])
}

I also tried to open this file via Hex Editor and it also didn't work.

How can I read or open this file to see the decoded text?

Thank you

Beril Boga
  • 97
  • 2
  • 9
  • Without access to your file, which we don't have, I find the question unanswerable. In particular, if a hex editor doesn't work I doubt R is the right tool to solve your problem. – Rui Barradas Jan 10 '19 at 06:58
  • You're totally right @RuiBarradas but I cannot provide this since this is a production data. I was trying to ask a way to do it if anyone have any idea or something. Anyway thanks. – Beril Boga Jan 10 '19 at 08:53

0 Answers0