#1 : 14/02-22 15:23 Mike
Posts: 3
|
Is it possible to use the renumber funktion to number files like 1,1,1,1,2,2,2,2,3,3,3,3 ?
So basicly use a skip of 1/4, if this makes sense. If you have another idea how to do it, please let me know. |
#2 : 15/02-22 09:18 David Lee
Posts: 1125
|
Use a Script method:
n = app.parseTags("<IncNr:1>"); n = Math.ceil(n/4); return n; This will correctly rename files as requested but when executed it will fail whenever it would result in multiple files in with the same name in the same folder. |
#3 : 15/02-22 14:07 Mike
Posts: 3
|
Reply to #2:
My file names have the structture x-1-1 , x-1-2, x-2-1 x-2-2 then y-1-1 , y-1-2, y-2-1, y-2-2 and so on. This would work perfect for me if it , if it would only apply to the first number in the name, because then it would only produce unique names, while still conserving the second and third number. If you have an idea, that would be much appreciated, as i am not familiar with the script language. |
#4 : 15/02-22 16:23 David Lee
Posts: 1125
|
Reply to #3:
That does not make any sense at all to me! What are x & y and what exactly are you trying to achieve? Try posting a real example showing before and after. |
#5 : 16/02-22 11:31 Mike
Posts: 3
|
Reply to #4:
Sry for being confusing, i will try to give real examples now. I have some microscope files, that i need to convert into a specific name format to import into an analysis programm. The original names look like this: 015001001.flex - Well A-1; Field #1 - C=0 015001001.flex - Well A-1; Field #1 - C=1 015001001.flex - Well A-1; Field #2 - C=0 015001001.flex - Well A-1; Field #2 - C=1 015001001.flex - Well A-2; Field #1 - C=0 015001001.flex - Well A-2; Field #1 - C=1 015001001.flex - Well A-2; Field #2 - C=0 015001001.flex - Well A-2; Field #2 - C=1 This is the file name format i want to achieve. A1--W00001--P00001--GFP A1--W00001--P00001--mCherry A1--W00001--P00002--GFP A1--W00001--P00002--mCherry A2--W00002--P00001--GFP A2--W00002--P00001--mCherry A2--W00002--P00002--GFP A2--W00002--P00002--mCherry My only problem is that i am unable to add the expression "W0000x" with x being in the format 1111,2222... Hope i made it clear now and thanks for your help. |
#6 : 16/02-22 19:34 David Lee
Posts: 1125
|
Reply to #5:
Try this - use a Replace method to fix the general format and numbering followed by a List replace method to add the specimen names. A) Replace method... Replace: ".*Well (\w)-(\d).*#(\d) - " with: "\1\2--W0000\2--P0000\3--" Use regular expressions B) List replace method - two lines 1) Replace: "C=0" with: "GFP" 2) Replace: "C=1" with: "mCherry" Quotes are for indication only, do not include them in the methods. |