RexName
Previous Topic  Next Topic 

This tutorial explains how using an application titled RexName, you can search and replace folder and file names.  

 

In this tutorial we will use the example data output from the WEBCT submission system.   We will transform a folder structure into a format suitable for Markers Assistant.

 

Introduction

 

WEBCT enables the assessors to view assignments of individual students by accessing the submissions and associated files via a web based interface.  Access and assessment within the WEBCT online environment is time consuming due to the amount of time spent navigating around the interface and the sometimes slow network access times experienced during the teaching period.  

 

It is not feasible to assess the students from within the WEBCT environment due to the lack of any resources to provide effective marking guides, marks and any associated feedback to the students. 

 

WEBCT currently allow the submissions to be collated in to a single zip archive.  The archive arranges students files into individual folders identified by the assignments title, followed by the students full name.  The resulting file structure could look something like this.

 

 

A number of problems exist with the current structure of the zip archive constructed by WEBCT.  Generally the students are identified by their student number or student login Id as it is unique.   Including the assignment title does not add to the information and tends to clutter the screen hindering the users ability to identify students.  

 

A better folder structure could look something like this.

 

 

Each folder is identified by a unique number being the student number.  This enables you to use the automation features and search, retrieve and display submissions automatically, saving time and effort.  

 

To manipulate and change the folder labels,  two methods could be used.  Manually search and replace each folder label with the corresponding student number or ID or uses software to automate the process.  Manually searching and replacing folder labels is time consuming and potential for error exists.  Automating the process initially required the use of Unix scripts and was dependent of the presence of personnel with this specific expertise.  A search of the internet for a utility to do this type of task found nothing.  

 

As a consequence, a program titled RexName was developed.  

 

Two methods were developed to search and replace.  

 

Users can define a regular expression or search text and the text that will replace the entire folder name if found.  A base starting folder must be supplied as well as a batch file name where all changes will be logged and if required used to undo any changes made.  Other options enable files and  / or folders to be searched, results suppressed if required and other preferences as required.

 

 

Getting Started

 

To illustrate the use of RexName a zip file containing 4 folders labeled as below has been supplied when the software was installed.  

 

 

You should end up with a the following files and folders:

 

 

We need to search for a student name within the folder name and replace the entire folder name with that of the student ID number.  You could change the folder to the student login ID or any other unique identifier as long as it is the unique identifier you are using with Markers Assistant to identify students.  

 

There are two methods:

 


 

Search / Replace using a Script file

 

Where a group of students is to be searched, RexName accepts a text file containing each regular expression and it associated replacement text separated by a tab character.

RexName will search for each item in the batch file and if the item is found, replace the folder label with the replacement text.  Selecting the Delete Regular expression once a Match found option speeds up the processing considerably.

 

Example of Script file.  

 

NOTE: Spaces in the search text must be defined with a '\' character.

 

Format :Regular Expression<tab>Replacement Text

 

Albert\ Rag        88488488

Barry\ Smith        77388203

Jan\ Frank        999322667

Tom\ Carrol        200074672

 

 

 

 

 

 

 

 

Rexname will be launched.

 

 

 

Wait for the application to complete and you should have changed the folders names to the following:

 

 


 

Search / Replace individual item

 

You may search and replace individual items.

 

 

 

 

 

 

 

 

 

Rexname will be launched.

 

 

Wait for the application to complete and you should have changed the folder name to the desired label.

 


 

Search Replace File Names

 

Sometimes you may wish to change the file names of submissions to suit your assessment project.   For instance you may wish to remove all the spaces within file names or search specific text with a file name and replace it with a new label.

 

Where you want to search and replace file names, RexName accepts a text file containing each regular expression and it associated replacement text separated by a tab character.

RexName will search for each item in the batch file and if the item is found, replace the file label with the replacement text.  Selecting the Delete Regular expression once a Match found option speeds up the processing considerably.

 

Example of Script file.  

 

NOTE: Spaces in the search text must be defined with a '\' character.

 

Format :Regular Expression<tab>Replacement Text

 

Ass1\ 88488488.txt        Ass1.txt

Ass1\ 77388203.txt        Ass1.txt

Ass1\ 999322667.txt        Ass1.txt

Ass1-\ 200074672.txt        Ass1.txt

 

 

 

 

 

 

 

 

 

All files found matching the regular expression will be changed to the corresponding replacement text as defined in the rexnameFileScript.txt file.