Hi,
I am just getting started with Julia so apologies if this is too simple a question.
I have a series of directories (folders) with names as follows
6-ep2ddifftraDYNDIST-69284
7-ep2ddifftraDYNDISTMIX-61648
8-bfsfbsjahfa
…
etc.
Basically, a number, followed by a hyphen, followed by some gibberish (the gibberish has no consistency in length, value, or anything).
I want to rename all of these folders to just the number,
so for example
6-ep2ddifftraDYNDIST-69284 becomes 6
7-ep2ddifftraDYNDISTMIX-61648 becomes 7
etc.
So, how would I go about doing this? I am quite new so I don’t know which packages to use or even where to begin finding this out. I can loop through the folders and do something to the effect of name=StringName[0] but I am not sure where to find the packages to do this,
thank you! I think that should work, but what do I do in the case that the folder number is 10 or greater? Would the string(first(f)) not have a problem with this as it only accesses the first entry? (alternately, is there a way to add leading zeros)