How to automatically change folder & file names in CodeIgniter? - codeigniter-3

I'm preparing all the files for Afghanistan then intending to copy the entire Afghanistan folder and pasting it in other country folders. I have a text editor to change the contents of each file but it wont change the folder & file names.
For example I want the following;
C:\xampp\htdocs\application\views\afghanistan\afcontactus\afcomplaint
\afcontactus\afcomplaint
for Albania changed to;
C:\xampp\htdocs\application\views\albania\alcontactus\alcomplaint
\alcontactus\alcomplaint
and for Algeria changed to;
C:\xampp\htdocs\application\views\algeria\dzcontactus\dzcomplaint
\dzcontactus\dzcomplaint
If CodeIgniter can also change the contents I'll be able to do the lot in one operation.
Can anybody help?

Related

How to rename an XML file using the pattern in a different .txt file?

I have a folder say, source folder, containing 1000+ xml files with some ambiguous names, like:
_MIM_15646432635_6664684
_MIM_54154548557_6568436 etc.
Out of these thousands of XML files I’ve to select some 10-12 xml files with a particular node in them and move them to another folder (destination folder) and rename the files respectively with some meaningful names.
For example:
There is an xml file with name _MIM_15646432635_6664684 and it contains a node pattern like: “bab6e7h835468eg” and I’ve to rename it to name like: {1FE9909E-4450-B98665362022}
So for this I’ve to write a script which will search the file in source folder and if it finds my desired node pattern then move this file to destination folder post renaming it to some meaningful name.
Provided I’ve an excel sheet where I do have a list of two columns, one containing the specific node pattern and column two has a respective new name list.
Currenty, I’ve a script which can search a file and move it to another folder provided I’m giving input to the script with the node pattern and file name from that excel sheet:
Select-String – Path “\Dubwta01\AIR\Invalid*.xml” – Pattern ‘bab6e7h835468eg’ | %{Copy-Item – Path $_.Path – Destination ‘\Dubwta01\AIR\Invalid{1FE9909E-4450-B98665362022}.xml’
What now I need is that a new script which will pick all 10 files from source folder and move it to destination folder by renaming it and I don’t have to hard code the pattern and new name in script rather it shall fetch the details from that excel or I can save the details in text files whatever is suitable for script to pick the name and pattern from.

Powershell Only:File name change according to mapping file and then copy to another directory

I have a mapping file in import.CSV as following:
Name|Business
Jack|Carpenter
Rose|Secretary
William|Clerk
Now, I have a directory which contains files like
90986883#Jack#Sal#1000.dat
76889992#Rose#Sal#2900.dat
67899279#William#Sal#1900.dat
12793298#Harry#Sal#2500.dat
Please note #Sal will always be there after Name. I need to pick these files and put into another directory and end result in second directory should look like.
90986883#Carpenter#Sal#1000.dat
76889992#Secretary#Sal#2900.dat
67899279#Clerk#Sal#1900.dat
Basically Files need to be renamed based upon CSV file and if Name is not there in file name , then there is no action required. Please note that source file should not be changed.
I will appreciate all kind of help.

How to insert a link to a folder

I can insert links to specified documents within folders, I want to be able to insert a link that takes the user to the folder to open up any document within.
I've tried something to the effect of this, but get an error ///server/share/etc
///server/share/etc
It wont take the file address that I am inputting in the 'insert link' option.
So you can link to a folder, it should be in this format:
file:///"Drive":%5C"folder"%5C"folder"%20"folder"%5C"folder"%20"folder"/
Items in "" are to be filled in. the %5C is to separate folder names, and the drive from the first folder. %20 is used in place of spaces between words of a folder. like New%20Folder.

MatLab - accessing subfolders of folders saved as variables

I have the following code which can create a directory within a selected folder:
photos_dir = 'C:\Users\Bob\Photos';
mkdir(photos_dir,'Christmas 2015')
I'd like to then be able to save an image to this folder, I think using something like:
imwrite(img,Christmas 2015,'jpg')
However, this does not select the "Christmas 2015" folder which is in the "\Photos" directory. How can I make the image be written to this location?
First of all, you're going to have a syntax error since Christmas 2015 should at least be a string. But other than that, if you want to save a file in a particular location (other than the current working directory), you need to provide the full path to the file location.
To do this, you need to use fullfile to combine all of your directory and file names together into a full file path.
image_name = fullfile(photos_dir, 'Christmas 2015', 'yourphoto.jpg');
imwrite(img, image_name, 'jpg')

C# folder and subfolder

Upon numerous searches, I am here to see if someone has any idea on how I should go about tackling this issue.
I have a folder with sub-folders. The sub-folder containers each has files of different file types e.g. pdf, png, jpeg, tiff, avi and word documents.
My goal is to write a code in C# that will go into the subfolder, and combined all the files into one pdf using the name of the folder. The only exception is that a file such as avi will not be pdf'ed in which case I want a nudge as to which folder it is and possibly file name. I am trying to use the form approach, so that you can copy in the folder pathname and also destination of the created pdf.
Thanks.
to start, create a FolderBrowserDialog to get the root folder. Alternatively just make a textbox in which you paste the folder name ( less preferred since the first method gives you nicer error-handling straight out of the box )
In order to iterate through, see How to: Iterate Through a Directory Tree
To find the filetype, check System.IO.FileInfo.Extension for each file you iterate through. Add those to list with the data you need. ( hint, create a list of objects in which your object reflects the data you need such as path, type etc,... ). If its an avi don't toss it in the list but flash a warning (messagebox?) instead.
From here the original question gets fuzzy. What exactly do you need in the pdf. Just the filenames and locations or do you actually want to throw the actual contents of the file in pdf?