I need to read a delimited file with | delimiter, whole characters quoted using "" and escape character as BACKSLASH.
The file data has 5 columns with Col1 .. Col5 where Col3 has values which are again delimited multiple values.
This issue seems very related to the particular details of the text, therefore its best to format the text as code, to preserve it accurately as the forum interpreter may alter or obfuscate the issue.
It may not be a fancy solution but if the pattern is consistent why not just open the .txt file in a text editor and a couple of global find and rplace operations?
I occasionally use dtplyr to benefit from data.table speed but leverage my existing knowledge of how tidyverse syntax goes (and my relative lack of knowledge of the data.table syntax; dtplyr might be useful to you similarly.
Ah, thanks but I know less about {dplyr} than I do about {data.table}.
I ran into data.table years ago, pre-tidyverse, when I was just starting to learn R and was a bit scared by the data.table syntax. I was having enough trouble with Base R. It was just last year or so that I realized how handy it is.
I am not a great fan of dplyr as I find it is way too verbose. {data.table} has a conciseness that appeals. I am reminded of going from SPSS to SAS/Systat.
My background is in psychology and for practical reasons, back in the stone age, SPSS was preferred over SAS in general. It was a revelation to discover SAS.
To my amazement, I was talking to a shiny brand-new graduate student in Psych the other day who was bemoaning the fact that her new department wanted her to learn R. After all the SPSS she had learned working with her undergrad advisor.
In many ways the data.table syntax is much simpler in my opinion, at least for standard dataframe manipulations. I view it as a turbo-charged dataframe enhancement to R with some fantastic additions like fread() & fwrite() (whereas the tidyverse packages have pretty much evolved to form a new language in their own right) .
I had a similar experience recently of having to combine many csv files. I started with read_csv() until I found errors because the files had a variable number of header rows to be skipped. fread() dealt with this without any issues.
As for dtplyr, I would only use it as a help to learn or check data.table syntax.
My experience was going from {tidyverse} to {base} made it much easier to finally crack {data.table}. Looking back over the approximately 6 month experience, I realized that {data.table} and {base} are far less syntax intensive over all.