Skip to content

replace string by pattern ? #14

@moodymudskipper

Description

@moodymudskipper

It's not an unglueing feature but more about aggregating by pattern.

Say I have some file names , like those but in big numbers and with more patterns:

c(
  "John report January.doc",
  "Brian report March.doc",
  "Summary 2018.xls",
  "Summary 2017.xls",
  "unstructured isolated file name.doc")

in order to count or to aggregate, it would be nice to be able to give as input the patterns
"{name} doc {month}.doc" and "Summary {year}.doc", and get as an output :

c(
  "{name} doc {month}.doc",
  "{name} doc {month}.doc",
  "Summary {year}.doc",
  "Summary {year}.doc",
  "unstructured isolated file name.doc")

Maybe the default should be to output :

c(
  "{name} doc {month}.doc",
  "{name} doc {month}.doc",
  "Summary {year}.doc",
  "Summary {year}.doc",
  NA)

And then it's an option to keep original string if unmatched ?

No real good name idea...

Maybe something like unglue_simplify(), unglue_generalize(), unglue_to_pattern() ?

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions