Good day,
In Kettle Pentaho, if use Move files..., then we can edit the file name in the destination, like specify date time format, so the file like abc.txt will become abc02012015.txt in the destination.
However, in Copy files..., I cant see this option. Anyway to do the same things as Move files...?
You can try "Copy or Move result filenames" Step. Here you can append a date pattern while copying files.
Hope it helps :)
You can check "Destination is file" in Settings in Copy file step and then in "Destination File/Folder" write folder with specify filename
Related
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.
I have multiple .ktr transformation files in one of my folder. I've used spaces in the naming convention. So, I want to rename all those pentaho transformation files using "Spoon". Are there any steps that can rename all my files at once?
Example : I've file calles "Invoice Items.ktr".
I want to rename this file to "InvoiceItems.ktr".
There isn't a step that does "Rename" action, you need to generate a new filename and move the file to itself.
You can use this with a series of steps for this.
EDIT:
In the get file names step, in the Wildcard column, use RegEx ".*", this will select all files within that folder. In the File/Directory column you leave only the directory, not the full filename.
I want to move all the files listed in a text document (logs.txt) to a archive folder. I tried with the below mentioned command but I was unable to move the listed files to the archive folder.
Command:
move C:\Users\krishna\Desktop\Backup\logs.txt C:\Users\krishna\Desktop\Backup\Archive
Note: I am able to move only text file but not the files listed in the txt file
Can anyone please help me in fixing this?
-
Assuming each filename is on its own line (if this is not the case please update me on the format of the logs.txt), you'll need to loop through each line and use that text to move the desired file. The following is something I came up with after some quick research. I'm not a windows guy myself but you can give it a shot and see if that works for you.
for /F "tokens=*" %A in (C:\Users\krishna\Desktop\Backup\logs.txt ) do (
move %A C:\Users\krishna\Desktop\Backup\Archive
)
How can I make a batch file that will create a folder (in a specified directory) that will create a folder and label it with today's date? Can I also make it delete folders that are one week old or older?
One question at a time. Addressing your first one:
cd \YourSpecificDirectory
SET Today=%Date:~10,4%%Date:~4,2%%Date:~7,2%
REN Creates folder in format 20050812 (depending on regional settings and language)
md %Today%
Answers to your second question (how to delete a folder before a certain date) already exist here. A search should find them for you pretty easily.
Please see this post how to get data value independent of data/Time format (zone):
batch file to copy some files and changing their name
MQFTE picks the files and copies in the destination by alphabetical order (if I am not wrong). Is it possible to pick the files from the source path by file size or by file extension or any other order. If not can it be customized by any other means?
You can customize your transfer with ANT script. I tried & it works.