I have a line that look like this:
INSERT INTO `table_name` VALUES (1,'some','body','+'), (2,'once','told me','+'), (3,'the world','is gonna roll me','+'))
And I'm trying to parse it as a dataframe such as:
tibble::tribble(
~col1, ~col2, ~col3, ~col4,
1, "some", "body", "+",
2, "once", "told me", "+",
3, "the world", "is gonna roll me", "+",
)
#> # A tibble: 3 × 4
#> col1 col2 col3 col4
#> <dbl> <chr> <chr> <chr>
#> 1 1 some body +
#> 2 2 once told me +
#> 3 3 the world is gonna roll me +
In short, take the content between each parentheses set as a line and separate it by ,
.