Epiconcept-Paris / STRAP-epiuf

Utility function package for STRAP
0 stars 0 forks source link

Edits to utilsFiles to facilitate searching for / replacing text strings in an entire repository, and easily retrieving the list of locations #120

Closed epi-jhd closed 2 weeks ago

epi-jhd commented 3 months ago

These changes are designed to facilitate the work of the admin team when they change the drive file structure and we all need to hunt through our scripts to find if/where we have referenced files on the drive and change them to match the new path.

gdesve commented 3 months ago

Thanks Jenny, I will work on STRAP this week and that review will be part of my duty ;)

epi-gde commented 3 months ago

Thanks for changes on txtFindReplace, xlsxFindReplace, fileFindReplace and FilesFindReplace , listing number of changes is great and work well !

epi-gde commented 3 months ago

I see some redondance between listFiles and getAllFilepath, why not using the first one ?

epi-jhd commented 3 months ago

As far as I understand, listFiles looks into just one level (ie the folder its given) - I needed a function that follows each filepath to the end and can thus get ALL the files within every folder and sub folder. Perhaps we could edit listFiles to have this option? as well as the option to show the full filepath, not just the the file name.

epi-gde commented 3 months ago

As far as I understand, listFiles looks into just one level (ie the folder its given) - I needed a function that follows each filepath to the end and can thus get ALL the files within every folder and sub folder. Perhaps we could edit listFiles to have this option? as well as the option to show the full filepath, not just the the file name.

ListFiles look recursively into each subdirectories and all sub sub directories (GetAllFiles only looks in first level of subdirectories) . ListFiles has an option to forget hiden directories but no easy option to exclude some ListFiles has a pattern option which let you choose all files with vaccin in name but no option to easily select types (even if this can be done with pattern) Then I suggest to merge them by integrating getAllFiles option into listFiles (which is natively recursive by using base R functions)

epi-jhd commented 3 months ago

I found the recusive functionality of listFiles (did not know abou this!) and it thus does everything required. I have remove getAllFilespaths as not needed.

epi-jhd commented 2 weeks ago

Ready to merge?