-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rename Output.cs
41 lines (30 loc) · 1.19 KB
/
Rename Output.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
using System;
using System.IO;
using System.Windows.Forms;
using System.Collections.Generic;
using System.Linq;
using BioSero.GreenButtonGo.Scripting;
namespace GreenButtonGo.Scripting
{
public class Rename_Output : BioSero.GreenButtonGo.GBGScript
{
public void Run(Dictionary<String, Object> variables, RuntimeInfo runtimeInfo)
{
// Insert code here:
string Identifiers = variables["Identifiers"] as string;
// MessageBox.Show(Identifiers);
string[] IdentifiersSplit= Identifiers.Split('\\');
string FileName = IdentifiersSplit[5];
// MessageBox.Show(FileName);
string[] FileNameSplit = FileName.Split('_');
string Prefix = FileNameSplit[0];
// MessageBox.Show(Prefix);
DirectoryInfo d = new DirectoryInfo(@"\\MolecularDevice\Qpix\thirdparty-identifiers\output");
FileInfo[] infos = d.GetFiles();
foreach(FileInfo f in infos)
{
File.Move(f.FullName, f.FullName.Replace("QPix_",Prefix+"_QPix_"));
}
}
}
}