Created
June 9, 2021 07:42
-
-
Save anupammaiti/5eb0a2fac941ae6b0f26675e753f746f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com; | |
import java.io.File; | |
import java.io.IOException; | |
import java.nio.file.Files; | |
import java.nio.file.Path; | |
import java.nio.file.Paths; | |
import java.util.ArrayList; | |
import java.util.List; | |
import java.util.Scanner; | |
public class MoveFile { | |
public static void main(String[] args) throws IOException { | |
String token1 = ""; | |
Scanner inFile1 = new Scanner(new File("C:\\Users\\ANUPAM\\shiva\\MovePhoto\\file\\FileName.txt")) | |
.useDelimiter("\n"); | |
List<String> temps = new ArrayList<String>(); | |
while (inFile1.hasNext()) { | |
token1 = inFile1.next(); | |
temps.add(token1); | |
} | |
inFile1.close(); | |
for (String fileName : temps) { | |
Path temp = Files.move( | |
Paths.get("F:\\ImageRepositoryBridge\\Shivan's Rice Cerimony\\Raw\\All\\ANU_" + fileName.trim() + ".NEF"), | |
Paths.get("F:\\ImageRepositoryBridge\\Shivan's Rice Cerimony\\Raw\\Sorted\\ANU_" + fileName.trim() | |
+ ".NEF")); | |
if (temp != null) { | |
System.out.println("ANU_" + fileName + ".NEF Moved"); | |
} else { | |
System.out.println("Failed to move :ANU_" + fileName + ".NEF"); | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment