Tag: connect 2016 presentation files

After download all files i just want to rename the files to presentation titles. I search for a rename software but the problem was not about software. The problem was how to get the relationship with the file and the presentation name.

I open every pdf file and get the presentation title and create the relationship. After that a small java program rename all files on a folder.

The file bellow has the relationship

renamer.txt

The java code bellow rename the files on the folder. Just put the reanamer.txt and Rename.jar on the same folder of the dowloaded files and run java -jar Rename.jar

import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;

public class Rename {

    public static void main(String[] args) throws FileNotFoundException {
        BufferedReader br = null;
        String line = "";
        String cvsSplitBy = ",";
        String csvFile = "renamer.txt";
        br = new BufferedReader(new FileReader(csvFile));

        try {
            while ((line = br.readLine()) != null) {
                    
                    String[] oldName = line.split(cvsSplitBy);
                    
                    System.out.println(oldName[0]);
                    System.out.println(oldName[1]);
                    
                    File oldfile = new File (oldName[0]+".pdf");
                    File newfile = new File (oldName[1]+".pdf");
                    if (oldfile.renameTo(newfile)) {
                        System.out.println("Rename sucessfull");
                    }
                    
                }
        } catch (IOException e) {
            
            e.printStackTrace();
        }

        
            try {
                br.close();
            } catch (IOException e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
            }        
    }

}

Rename.jar

 

Uncategorized