I have a text file that appears tab-delimited but some of the lines have two tabs between columns. When I read into R everything looks great until I hit one of these lines and then breaks down.
My guess is that I need something to say that if one tab follows another tab the second one should be ignored.
I've tried using read.table with and without a sep="\t" as well as read_table.
data <- read.table("frog.txt",sep="\t", skip = 9, header=TRUE)
What I should get out of this is:
|Ind |Ad |Brand |Net |Date |Program |Genre |Metric| |167 |Widg |Beta |UPN |1/1 |Bob |Anim |100 | |168 |Widg |Gamma |TNN |2/2 |Burger |Anim | 50 | |169 |Cog |Beef |TLA |3/3 |Cheers |Com |199 |
But what I'm getting is
|Ind |Ad |Brand |Net |Date |Program |Genre |Metric| |167 |Widg |Beta |UPN |1/1 |Bob |Anim |100 | |168 |Widg |Gamma |TNN |2/2 |Burger Anim 50 | |Cog Beef TLA 3/3 Cheers Com 199 |