I used the rename command to batch rename files. So far I have had files like:
2010.306.18.08.11.0000.BO.ADM..BHZ.SAC 2010.306.18.08.11.0000.BO.AMM..BHZ.SAC 2010.306.18.08.11.0000.BO.ASI..BHE.SAC 2010.306.18.08.11.0000.BO.ASI..BHZ.SAC
and using rename 2010.306.18.08.11.0000.BO. "" * rename 2010.306.18.08.11.0000.BO. "" * and rename .. _. * rename .. _. * , I reduced them to:
ADM_.BHZ.SAC AMM_.BHZ.SAC ASI_.BHE.SAC ASI_.BHZ.SAC
what I want. Probably a little clumsy, but it works. The problem now occurs when I have files like:
2010.306.18.06.12.8195.TW.MASB..BHE.SAC 2010.306.18.06.14.7695.TW.CHGB..BHN.SAC 2010.306.18.06.24.4195.TW.NNSB..BHZ.SAC 2010.306.18.06.25.0695.TW.SSLB..BHZ.SAC
which exist in one folder. I am trying to get similar results above using wildcards in the rename command, for example. rename 2010.306.18.*.*.*.*. "" rename 2010.306.18.*.*.*.*. "" , but this adds a first appearance to 2010.306.18.*.*.*.*. to the beginning of all the other files is clearly not what I need, so I get:
2010.306.18.06.12.8195.TW.MASB..BHE.SAC 2010.306.18.06.12.8195.TW.MASB..BHE.SAC2010.306.18.06.14.7695.TW.CHGB..BHN.SAC 2010.306.18.06.12.8195.TW.MASB..BHE.SAC2010.306.18.06.24.4195.TW.NNSB..BHZ.SAC 2010.306.18.06.12.8195.TW.MASB..BHE.SAC2010.306.18.06.25.0695.TW.SSLB..BHZ.SAC
I assume that I do not understand the rather fundamental principle of wildcards here, can someone explain why this does not work and what I can do to get the desired result (preferably with rename ).
NB
To clarify, the output should be:
ADM_.BHZ.SAC AMM_.BHZ.SAC ASI_.BHE.SAC ASI_.BHZ.SAC MASB.BHE.SAC CHGB.BHN.SAC NNSB.BHZ.SAC SSLB.BHZ.SAC
heds1 source share