From 6cb1fdfcf3758d96316afc86abc5b801ff6a2282 Mon Sep 17 00:00:00 2001 From: Kathy <37816304+kathy-snider@users.noreply.github.com> Date: Wed, 10 Mar 2021 08:27:16 -0800 Subject: [PATCH] Explain patterns. --- README.md | 29 ++++++++++++++--------------- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index c7d4315..f71fc34 100755 --- a/README.md +++ b/README.md @@ -6,27 +6,26 @@ The JSON file contains 2 elements: * The directory tree of the folder being cleaned in the "file_system_data" of - * the json. This is the "rules" portion that tells the script what to do (keep - * or delete) for each file and folder. The tree must match the directory tree - * of the folder being cleaned. + the json. This is the "rules" portion that tells the script what to do (keep + or delete) for each file and folder. The tree must match the directory tree + of the folder being cleaned. * The "pattern_list" whose value is a list of pattern strings. ## Patterns > If the data to be cleaned contains numbered files or folders, you can choose -> to apply a rule (keep or delete) for one numbered file to all matching, -> numbered files and folders. +to apply a rule (keep or delete) for one numbered file to all matching, +numbered files and folders. To do this, either add a pattern to the "pattern_list" or use the pattern flag in the cleaning script, below. #### Example 1 > You have BIDS data and a lot of files and folder contain strings like -> "task-rest_run-01". You don't know how many runs there are going to be, but -> you want the rules for all task-rest runs to be the same. - * Put rules in your tree for files and folders whose names contain - * "task-rest_run-01". +"task-rest_run-01". You don't know how many runs there are going to be, but +you want the rules for all task-rest runs to be the same. + * Put rules in your tree for files and folders whose names contain "task-rest_run-01". * Add the pattern "task-rest_run-\*" to the list value of the "pattern_list" - * element. (The \* is shorthand for all numbers.) +element. (The \* is shorthand for all numbers.) All rules containing "task-rest_run-" followed by any number will be applied to all files and folders whose names contain "task-rest_run-" followed by any @@ -38,9 +37,9 @@ patterns until you get used to them. #### Example 2 > There is a set of files in your data called temp01, temp02, .... Again, you -> don't know how many there will be, but you want them all gone. +don't know how many there will be, but you want them all gone. * Make a rule for a file called temp0 (or temp6 or temp382 - doesn't matter, -* just temp followed by a number). Set the value of its "state" to "delete". +just temp followed by a number). Set the value of its "state" to "delete". * Add a pattern to the list for "temp*". Don't worry, all of your files with "template" in their names will not @@ -49,7 +48,7 @@ disappear. Only files with the string "temp" followed directly by a number. ## CustomClean Cleaning Script (`cleaning_script.py`) > Delete things in a given directory based on the rules and patterns given in -> the JSON. +the JSON. Required arguments: * -j --json [path to JSON] @@ -66,8 +65,8 @@ of the target directory. ## CustomClean GUI > **NOTE** As of 2.0.0, the cleaning script does not work with JSON files -> created by the CustomClean GUI. To use the GUI and a cleaning script, use an -> older version of CustomClean (pre 2.0.0). We hope to remedy this soon! +created by the CustomClean GUI. To use the GUI and a cleaning script, use an +older version of CustomClean (pre 2.0.0). We hope to remedy this soon! ## Installation 1. Requires Python.