-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCopy.java
59 lines (44 loc) · 1.54 KB
/
Copy.java
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package copy;
import java.io.*;
import java.nio.file.Files;
import java.util.List;
/**
*
* @author Snehal
*/
public class Copy {
/**
* @param args the command line arguments
*/
public static void main(String[] args) throws FileNotFoundException, IOException {
// TODO code application logic here
String s="",Line;
FileReader fr1 = new FileReader("J:\\IMSc\\Agos\\output\\OnlyY.csv");
BufferedReader br1 = new BufferedReader(fr1);
while((Line=br1.readLine())!=null)
s = s + Line + ".fasta"+" ";
System.out.println(s.split(" ").length);
File destinationFolder = new File("J:\\utr874");
File sourceFolder = new File("J:\\utr1000");
// Get list of the files and iterate over them
File[] listOfFiles = sourceFolder.listFiles();
if (listOfFiles != null)
{
for (File child : listOfFiles )
{
if(s.contains(child.getName()))
// Move files to destination folder
{
child.renameTo(new File(destinationFolder + "\\" + child.getName()));
//s.replaceAll(child.getName(),"");
}
}
}
//System.out.println(s);
}
}