-1

my test.txt file looks like this

"Nr" | | "X1" | | "ID_T20" | | "Herstellernummer" | | "Werksnummer" | | "Fehlerhaft" "1" | | 1 | | "20-211-2111-14" | | "211" | | "2111" | | 0

I tried a lot of commands to import it as a data frame like this:

 "Nr" , "X1" , "ID_T20"         , "Hersteller" , "Werksnummer" , "Fehlerhaft"

 "1" ,   1  , "20-211-2111-14" , "211"        , "2111"        ,0

can you help me?

Duck Dodgers
  • 3,409
  • 8
  • 29
  • 43
  • 3
    Possible duplicate of [Importing "csv" file with multiple-character separator to R?](https://stackoverflow.com/questions/18186357/importing-csv-file-with-multiple-character-separator-to-r) – Valentino Feb 21 '19 at 12:07

1 Answers1

0

Possibly:

x = strsplit(readLines(x), "\\|\\|")[[1]]
x = data.frame(x, stringsAsFactors=F)
Adam Waring
  • 1,158
  • 8
  • 20