Renaming dynamic file name using batch script
Closed
                    
        
                    sriharsha711
    
        
                    Posts
            
                
            2
                
                            Registration date
            Wednesday June 12, 2013
                            Status
            Member
                            Last seen
            June 12, 2013
            
                -
                            Jun 12, 2013 at 11:57 AM
                        
Blocked Profile - Jun 12, 2013 at 03:14 PM
        Blocked Profile - Jun 12, 2013 at 03:14 PM
        Related:         
- Batch script rename file with date
 - Rename lg tv - Guide
 - Rename computer cmd - Guide
 - Windows 10 iso file download 64-bit - Download - Windows
 - Dvi file - Guide
 - Batch file open folder ✓ - Windows Forum
 
3 responses
                        
                            
                    This is created in notepad, and saved as .bat file
Be certain to change the file paths to those that are specific to your environement
where z is your mapped drive to "Informatica Secure"
@echo off
set /p txtfile=Filename without Path assumes c:\:
echo.%txtfile%
copy %txtfile% z:\testing\dealer.txt
echo Come back to this window when Agent is done with process. The copy file will be deleted.
@pause
copy %txtfile% c:\somefolder\namedsuccess\%txtfile%
del z:\testing\dealer.txt
exit
I hope this helps.
                
                
            Be certain to change the file paths to those that are specific to your environement
where z is your mapped drive to "Informatica Secure"
@echo off
set /p txtfile=Filename without Path assumes c:\:
echo.%txtfile%
copy %txtfile% z:\testing\dealer.txt
echo Come back to this window when Agent is done with process. The copy file will be deleted.
@pause
copy %txtfile% c:\somefolder\namedsuccess\%txtfile%
del z:\testing\dealer.txt
exit
I hope this helps.
                        
                    I hope this reply finds you in good spirits.
Incoming file into where? Your email client? Your mapped drive?
I will be happy to assist once I understand the environment.
 
                
                
            Incoming file into where? Your email client? Your mapped drive?
I will be happy to assist once I understand the environment.
                
        
                    sriharsha711
    
        
                    Posts
            
                
            2
                
                            Registration date
            Wednesday June 12, 2013
                            Status
            Member
                            Last seen
            June 12, 2013
            
                    
Jun 12, 2013 at 01:15 PM
    Jun 12, 2013 at 01:15 PM
                        
                    Hi Mark,
Sorry I wasn't a bit more specific.
I have an incoming file every month(Would be placed in my Informatica Secure agent machine using Windows XP) which is of the format MMDDYYYYDealer.txt. I need to rename it prior to processing by informatica to some common name such as Dealer.txt so that I can use it in my Source connection.After the processing is done I need to move the file with the original name to a specified folder
 
So lets say I receive 12022013Dealer.txt in my folder
I copy this to a new folder
rename the file in my original folder
After Informatica Processing I will move the copied file with original name to a success folder and delete the renamed file.
            Sorry I wasn't a bit more specific.
I have an incoming file every month(Would be placed in my Informatica Secure agent machine using Windows XP) which is of the format MMDDYYYYDealer.txt. I need to rename it prior to processing by informatica to some common name such as Dealer.txt so that I can use it in my Source connection.After the processing is done I need to move the file with the original name to a specified folder
So lets say I receive 12022013Dealer.txt in my folder
I copy this to a new folder
rename the file in my original folder
After Informatica Processing I will move the copied file with original name to a success folder and delete the renamed file.