Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

SkiHound2

macrumors 6502
Original poster
Jul 15, 2018
458
377
I'm a statistician working with data being sent to me as Excel files. Each subject has 5 separate files. The first few files I got were named consistently.
1001_00.xlsx
1001_15.xlsx
1001_30.xlsx
1001_60.xlsx
1001_90.xlsx

Where the first 4 digits are subject identifiers, and 00, 15, ... 90 denote baseline and follow-up time points. I can write code to read these data and append into an analyzable format.

I was then sent additional data that has all kinds of inconsistencies. E.g.,
1002 M6.xlsx
1003_M6.xlsx
1004_BL.xlsx
1005 M1.xlsx

So what I need to be able to do is to selectively rename files. E.g. rename
1002 M6.xlsx to 1002_60.xlsx
1003_M6.xlsx to 1003_60.xlsx

In short I want a command too rename all files with certain time designations. Like
rename *_M6.xlsx to *_60.xlsx where * is a wildcard.

No matter what it's going to be a PITA but I was wondering if anyone knew of any software that would handle a task like this.

Thanks,

Brad
 
I'm a statistician working with data being sent to me as Excel files. Each subject has 5 separate files. The first few files I got were named consistently.
1001_00.xlsx
1001_15.xlsx
1001_30.xlsx
1001_60.xlsx
1001_90.xlsx

Where the first 4 digits are subject identifiers, and 00, 15, ... 90 denote baseline and follow-up time points. I can write code to read these data and append into an analyzable format.

I was then sent additional data that has all kinds of inconsistencies. E.g.,
1002 M6.xlsx
1003_M6.xlsx
1004_BL.xlsx
1005 M1.xlsx

So what I need to be able to do is to selectively rename files. E.g. rename
1002 M6.xlsx to 1002_60.xlsx
1003_M6.xlsx to 1003_60.xlsx

In short I want a command too rename all files with certain time designations. Like
rename *_M6.xlsx to *_60.xlsx where * is a wildcard.

No matter what it's going to be a PITA but I was wondering if anyone knew of any software that would handle a task like this.

Thanks,

Brad

A Better Finder Rename could work, I think.
 
I think there's no need for a 3rd-party app, I'd try the built-in rename option in the Finder, it's pretty powerful already.
Just select multiple files > Right-click > Rename...
You could replace occurrences of "M" for nothing, and add a 0 at the end.
 
I think there's no need for a 3rd-party app, I'd try the built-in rename option in the Finder, it's pretty powerful already.
Just select multiple files > Right-click > Rename...
You could replace occurrences of "M" for nothing, and add a 0 at the end.

Thanks, I'll look more closely at the built in capabilities.
 
  • Like
Reactions: PsykX
Thanks for the suggestion. Kind of hard to tell for sure but it seems it would probably do what I need.
I'm certain it can. If you can describe the other rename rules (besides M{digit} > {digit}0) I'll put together a workflow and can send you the file if you wish.

Another nice thing with Name Mangler is you can save workflows to be runnable as either droplets or context-menu services.
 
I'm certain it can. If you can describe the other rename rules (besides M{digit} > {digit}0) I'll put together a workflow and can send you the file if you wish.

Another nice thing with Name Mangler is you can save workflows to be runnable as either droplets or context-menu services.
That's very generous and I may end up coming back to ask for advice. At this point I'm not sure what everything even looks like. I was sent some test files and everything was named consistently. Then I was sent some additional files, and all of a sudden the naming conventions weren't consistent. I clearly need to get all of the files to see just what everything looks like. I'm pretty irritated with this. When this was being developed I was asked if I would be able to read all of the data. I said yes BUT THE FILE NAMES HAVE TO ALL HAVE EXACTLY THE SAME STRUCTURE AND ALL NEEDED TO HAVE THE SUBJECT IDENTIFIER AND ASSESSMENT IDENTIFIER. But that doesn't seem to get communicated to all of the folks who are in the field collecting the data. They just have a good understanding of how to process the data and they don't really bring me into the process till it's too late. At any rate, thanks much for pointing me towards Name Mangler and your offer of assistance!
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.