Skip to content

Create cubids mv command to rename individual files or directories - #455

Draft
tsalo wants to merge 3 commits into
mainfrom
cubids-mv
Draft

Create cubids mv command to rename individual files or directories#455
tsalo wants to merge 3 commits into
mainfrom
cubids-mv

Conversation

@tsalo

@tsalo tsalo commented Apr 4, 2025

Copy link
Copy Markdown
Member

Closes #452. Currently just the outline of an idea.

Changes proposed in this pull request

  • Create a new CLI, cubids mv, to rename individual files or full directories. I'm modeling it on git mv.

@tsalo

tsalo commented Apr 4, 2025

Copy link
Copy Markdown
Member Author

Here's my plan for the behavior:

Move a file

cubids mv infile outfile

This renames the file and associated files, like a regular rename in cubids apply.

Rename a subject

cubids mv sub-01 sub-02

This renames the folder and the files in that folder. Each file being renamed basically goes through the same process as a separate file rename. Plus, since this is a whole subject, the participants.tsv should get updated too, along with any other top-level files that contain subject IDs.

It should update the following files:

  • participants.tsv
  • sub-01/sub-01_scans.tsv
  • sub-01/ses-/sub-01_ses-_scans.tsv
  • sub-01/sub-01_sessions.tsv

Rename a session

cubids mv sub-01/ses-1 sub-01/ses-2

This renames the folder and the files in that folder. It should update the following files (assuming they exist):

  • sub-01/sub-01_sessions.tsv
  • sessions.tsv (coming in a new BEP)
  • sub-01/ses-1/sub-01_ses-1_scans.tsv

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Is it possible to use cubids to rename individual files?

1 participant