Thread: Add character string in filename after fifth character
i have nice little script have written replacing strings in filenames.
http://jamesisin.com/a_high-tech_ble...naming-script/
works great time can use regex identify string replaced. problem i'm facing have bunch of files 2 (variable) bits need keep sandwiched no intervening string (not single character).
so, know have 2 numbers, dot, , 2 numbers (totaling 5 characters) @ beginning of each filename before want new string placed (such 01.05other stuff needed.flac).
have seen sed used similar within text files, i'm not familiar sed.
suggestions , samples welcome. thanks.
hi jamesisin.
since using parameter substitution already, may extract sub strings using position , length.
instance:
hope helps.code:$ var="01.05other stuff needed.flac" $ echo ${var:0:2} 01 $ echo ${var:3:2} 05
regards.
Forum The Ubuntu Forum Community Ubuntu Specialised Support Development & Programming Programming Talk Add character string in filename after fifth character
Ubuntu
Comments
Post a Comment