Copying file based on initial part of file's name and creation date

We have a client who dumps data in one of our 2003 SP2 server. We need a script to copy a single file from this location to 
one of our 2008 R2 server.Like in the source server we have
abc_Today'sDate_hexadecimal.csv  (File Name)
Today
               (Date Modified)
abc_YesterDay'sdate_hexadecimal.csv      (File Name)
Tomorrow         (Date Modified)
'abc' is constant in the file name where rest changes.  We want this file, whose name is starting with 'abc' and created today to be copied to destination, preferably replacing the file which was copied yesterday.
I know nothing about scripting so any help would be appreciated
Thanks

If you are hoping to get a complete solution, you won't as that is not the purpose of this forum.
If you are hoping to learn how to accomplish this task yourself with a little help, then this is the place for you, but...
you will be better off to start learning powershell, perhaps using this exercise as a practical example. So to start, you should type these commands in the powershell console:
help get-childitem
help copy-item
if the documentation that this presents makes no sense to you, you will have to get past the "knowning nothing about scripting" condition first. If so, someone here will no doubt provide some usefu references...
Al Dunbar -- remember to 'mark or propose as answer' or 'vote as helpful' as appropriate.
Excellent - wel stated. I wil keep this.
¯\_(ツ)_/¯

Similar Messages

  • Copying files between Iphone and PC over 3G-connection?

    Hi,
    Is there any application for copying files between PC and Iphone using a 3G or Edge connection? I'm using Jaadu VNC client on my Iphone but it has no functions for file transfers (as far as I know).
    Thanks for any hints!

    No. I don't believe that would be allowed with the SDK. You could always email them to yourself.

  • I had formatted external HDD as Mac OS Extended(journaled) earlier, but now i want to format the same as ExFAT so that i can copy files between PC and MAC. But it is giving 'Can't unmount' error while i try to run Erase

    I had formatted external HDD as Mac OS Extended(journaled) earlier, but now i want to format the same as ExFAT so that i can copy files between PC and MAC. But it is giving 'Can't unmount' error while i try to run Erase

    Use the PC to reformat the drive.

  • How to change the default password file's name and path when the database created?

    how to change the default password file's name and path when the database created?
    null

    Usage: orapwd file=<fname> password=<password> entries=<users>
    where
    file - name of password file (mand),
    password - password for SYS and INTERNAL (mand),
    entries - maximum number of distinct DBA and OPERs (opt),
    There are no spaces around the equal-to (=) character.

  • How can I copy file/folders from and to hard drives? How can I have two or more windows of explorer so that I can drag and drop from one hard drive to another?

    Hi,
    I am a new customer (purchased last week) of MacBookPro (latest) and its my first ever Apple laptop.
    I am almost lost to find the operating tools.
    1. How can I copy files from hard drive to computer and vis-a-versa?
    2. Only can browse one but how can I have two or more browses at the same time like in MS windows?
    3. No right click works on track pad?
    4. Is there application/ program compatible to MS office? If so how much and how can I purchase?
    5. Is there AutoCAD program that is compatible to MS Window AutoCAD? and if yes how much and how can I purchase?
    I will very much appreciate if you could email me the with the solution/answers please.
    Regards,
    Khagendra Limbu

    1) For some reason this happens once in a while with FAT32 enabled external harddrives. I have no idea why this happens but it most easily solved by reformatting the drive. First make sure you've copied everything from the external drive to your internal harddrive. You've done this earlier so I assume you know how to do this.
    Now the reformatting part. Open Finder and go to Applications. Look for the folder called "Utilities". Click on it. In it you find a program called "Disk Utility". Click on it. Now look for the external drive. You probably see two entries for the disk. Click on the one that contains the name of the drive NOT the one that describes the disk (Like for example 320.07 GB Samsung S2 Portable Media).
    Now you see four tabs in the righthand part of the window. They're called "First Aid", "Erase", "RAID" and "Restore". Click on "Erase". This opens the tab with (amongst others) a dropdownbox (Format) and a textbox (Name) . In the dropdownbox select "Mac OS Extended (Journaled). Take note! This selection disables usage of the drive with Windows PC's. If your goal is to share the drive with Windows PC's select the MS-DOS FAT option.
    Enter a label for the drive in the textbox Name. Now click on the button "Erase". This will format the drive.
    Now when it's done you can copy back all the items you've copied to your internal harddrive earlier.
    2) Opening two windows like Explorer on Windows is opening two Finder windows on the Mac. Simply click on the background. In the menubar you items like 'Finder", "File", "Edit", "View", et cetera. Click on "File" and "New Finder Window". Do this two times. Alternatively you can click on the background and press CMD-N two times.
    3) You can right click on the trackpad. This however depends on if you've enabled the feature in System Preferences. In the topmenubar click on the Apple icon and select "System Preferences". Now look for Trackpad in Hardware. Click on it. You see three tabs with the names "Point & Click", "Scroll & Zoom" and "More Gestures". Select "Point & Click" and look for "Secondary Click'. Make sure it is checked and make sure it has written "Click or tap with two fingers" written beneath "Secondary Click". When you're done exit System Preferences. Now select the background and tap with two fingers on the trackpad. This should open the contextuel menu with options like "New Folder", "Get Info" et cetera.

  • Copying files between iPod and PC

    I have iTunes running on my G5, and I want to copy files from the iPod to my computer, is this possible? If not, then why not? It seems like an obvious option, yet my computer won't allow it. I'm quite angry about this, as I intended to use my iPod as a storage system anyway... this is frustrating me significantly.

    Do you mean files in general or songs from the iPod to iTunes? If you want to use it as a removable drive then enable it for disk use. When connected it will mount on the desktop and you can open it in Finder: Using your iPod as a storage drive
    If you want to transfer songs from it and you have any iTMS purchases, the transfer of purchased content from the iPod to authorised computers has been introduced with iTunes 7. A paragraph on it has been added to this article:: Transfer iTunes Store purchases using iPod
    The transfer of non iTMS content such as songs imported from CD is designed by default to be one way from iTunes to iPod. However there's a manual method of copying songs from your iPod to your Mac. The procedure is a bit involved but if you're interested it's available at this link: Two-way Street: Moving Music Off the iPod
    If you prefer something more automated there are a number of third party utilities that you can use to retrieve music files and playlists from your iPod, this is just a selection. I use Senuti but have a look at the web pages and documentation for the others too, you'll find that they have varying degrees of functionality and some will transfer movies, videos, photos and games as well. You can also read reviews of some of them here: Wired News - Rescue Your Stranded Tunes
    Senuti Mac Only
    iPodRip Mac Only
    PodWorks Mac Only
    PodView Mac Only
    iPodAccess Mac & Windows
    YamiPod Mac & Windows
    PodUtil Mac & Windows
    iPodCopy Mac & Windows

  • Problem Copying Files using Drag and Drop in Finder

    When I try to copy files from a camera's SD disk into a folder in Finder, it always seems to copy the files to some other location other than the folder I drag and dropped to. And then, when I try to redo the drag and drop, I get a message that these files already exist in the desired folder, even though I don't see them there!
    Also when I create a new folder in Finder, it never places the new folder under the folder I've currently highlighted.
    I'd love to hear whats going on here!
    Ted

    tedpratt wrote:
    When I try to copy files from a camera's SD disk into a folder in Finder, it always seems to copy the files to some other location other than the folder I drag and dropped to. And then, when I try to redo the drag and drop, I get a message that these files already exist in the desired folder, even though I don't see them there!
    What Finder "view" option are you using, List, Icons, Columns, or Cover Flow, for this question and the one below? Are you dragging those photos onto the icon of a closed folder or somewhere else? Please describe the exact process that you're executing.
    Also when I create a new folder in Finder, it never places the new folder under the folder I've currently highlighted.
    When you say "under", do you mean "within"? A new folder will be placed in the folder that's open.

  • Copy files over network and preserve original date modified/created

    This problem originally cropped up when importing photos into iphoto. I copied all my pics across the network and stored them locally then imported them into iPhoto. Problem was, any pics that did not have EXIF data were sorted by iPhoto, by date created...which was the date they were copied to the Mac.
    I got around that by trashing the iPhoto Library, then importing the photos over the network. The dates on the pics were correct on the Windows machine till the copy process changed them.
    is there a way to copy across the network and keep all the file attributes as they are on the original..An archive type feature.
    I had thought of RsyncX, but have not used that yet from within the Mac.
    Is there a way from within Finder to copy and keep attributes? or a third party app?
    Neil

    zip the folder with your pictures (control-click on it and choose "compress folder"), copy the zip files to the remote computer and unzip it there. this will preserve the modified and created dates.

  • Using cfhttp, copied file is appended and original is overwritten

    I'm not sure if its the cfhttp configuration or if this is a problem with the webdav server configuration.
    Here's my CF code:
      <cftry>
            <cfhttp  method="put" url="https://#Application.psupload.Webdavserver##Application.psupload.Filetxt#" username="clb39" password="5wimF1shco" throwonerror="yes" path="#Application.psupload.Pathtxt#" multipart="Yes" timeout="30000">
                <cfhttpparam type="file" name="#Application.psupload.Filetxt#" file="#Application.psupload.Pathtxt##Application.psupload.Filetxt#">
            </cfhttp>
            <cfset Application.psupload.msg="#Application.psupload.msg# Webdav Success<br>">
            <cfcatch>
                <cfset Application.psupload.msg="#Application.psupload.msg# Webdav Failure<br>">
            </cfcatch>
        </cftry>
    It looks like a 'return code' that overwrites the original file:
    <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
    <html><head>
    <title>201 Created</title>
    </head><body>
    <h1>Created</h1>
    <p>Resource /[removed]/Upload_1103080403.txt has been created.</p>
    <hr />
    <address>Apache/2.2.15 (Unix) mod_ssl/2.2.15 OpenSSL/0.9.7d DAV/2 Server at [removed] Port 8[removed]0</address>
    </body></html>
    The copied file is made correctly, but some how 4 lines are added, and the 3rd one has this string each time:
    -------------------------------7d0d117230764--
    Any thoughts? Is it cfhttp or Webdav?
    TIA,
    CB

    The end result was bad coding. The proper format:
            <cfhttp  method="put" url="https://#Application.psupload.Webdavserver##Application.psupload.Filetxt#" username="*" password="**************" throwonerror="yes">
                <cfhttpparam type="file" name="#Application.psupload.Filetxt#" file="#Application.psupload.Pathtxt##Application.psupload.Filetxt#" mimetype="text/plain">
            </cfhttp>
    The original code was wrong b/c:
    path="#Application.psupload.Pathtxt#" - should be the return message path, ie log of transaction. By setting it equeal to the file to be copied, it gets overwritten.
    I did run into an additional issue creating the export file with an extra carriage return and line being added to the end of the file - this was a problem with cfloop and was resolved by 2 cfloop statements to the file, first writing queryrecords-1 and second just writing the last record in query without a new line
    Sample Code:
    <cftry>
                    <cfloop query="Pending" startrow="1" endrow="#(Pending.recordcount)-1#>
                        <cffile action="append"
                        file="#Application.psupload.Pathtxt##Application.psupload.Filetxt#"
                        output="#TRIM(UniqueAppID)#--- cut for clarity"                
                        addnewline="yes">
                    </cfloop>
                    <cfset Application.psupload.msg="#Application.psupload.msg# multi Local txt File populated sucessfully<br>">
                        <cftry>
                            <cfloop query="Pending" startrow="#pending.recordcount#" endrow="#pending.recordcount#">
                                <cffile action="append"
                                     file="#Application.psupload.Pathtxt##Application.psupload.Filetxt#"
                                     output="#TRIM(UniqueAppID)#-- cut for clarity"                
                                     addnewline="no">
                                </cfloop>
                            <cfset Application.psupload.msg="#Application.psupload.msg# multi Local txt File completed sucessfully<br>">
                                <cfcatch>
                                    <cfset Application.psupload.msg="#Application.psupload.msg# multi Local txt File Last record Failed<BR>">
                                </cfcatch>
                        </cftry>
                    <cfcatch>
                        <cfset Application.psupload.msg="#Application.psupload.msg# multi Local txt File population Failed<BR>">
                    </cfcatch>
                </cftry>
    Doing this mean I also need to control for when Pending has only 1 record, which other code handles.

  • Automator- create file names with creation date and time

    I have photo files that I want to rename with a base name, plus a sequential number, based on the creation date (and ideally time). It appears that Automator does not honor the time of the source file when date stamping a new set of files. If there is anyway to use date + time so I can recreate a date_timestamp in addition to a base filename, that would be great.

    Hi Nikhil_BI_Dev,
    According to your description, you find your report runs properly in BIDS but shows blank after deploying onto report server. Right?
    In this scenario, it might be the issue on retrieving data in SQL 2005. Here is a thread with same issue, please refer to the link below:
    Detail report is blank after deploying
    Reference:
    Using SQL Server 2005 Reporting Services with SQL Server 2005 Express Edition
    If you have any question, please feel fee to ask.
    Best Regards,
    Simon Hou

  • Get file name and received date & time

    Hello experts,
    We are loading around 10 source files(xml) on regular basis to Target table. I have to capture source filename & received datetime of those files and status of file whether it loaded successfully or not(I can care take care of status of file).  I want to automate this process using BODS and load filename, datetime and status data into one database table.
    For you information: File name looks like QAS_Wareneingang_20140328-190006-438.     ( from file name  ..190006-438 number is random number they are generating) and Date and time is constant for that day eg: 28.03.2014  19:00
    Could you please help me...
    Thanks & regards
    Mohan

    Thank you Arun for your kind help...
    I found a solution to find and move all related filenames with timestamp to  file_names.txt file using the batch script below.
    @echo on
    cd /D G:\BAUR
    dir /n Auslagerung* > G:\Dev_Users\BAUR\file_names.txt
    exit
    After that I used the above file as source and formatted using query transform in BODS.

  • How to find the file by name and identify its type?

    Hi,
    In a folder thare are many files, the file types are doc, docx, pdf, and rtf. The file name is something like "FirstName LastName(more extrat letters).filetype".
    Now I would like to find all the files with a certain name and identify their types. For example, by input "Bill Gates", I would get the list of all files :
    Bill Gates.doc, Bill Gates-2010.pdf etc ...
    Any good ideas are welcome.
    Pengyou

    For finding files whose names match a certain pattern, create a FileFilter or FilenameFilter that returns true when the name matches the pattern in question, and then call list() or listFiles() with that filter.
    For identifying the "type", that depends what you mean. File's don't actually have a type. It's just that they're interpreted as such in some contexts. The simplest thing is to just look at the extension. You can be more sophisticated than that, but that gets complicated real fast. It depends what you're actually trying to accomplish.

  • When I move files between mac the creation date changes, I want to keep the original dates.

    When I move files between a couple of Macs the creation date etc chnges to the time I'm moving them.
    I need to keep the original details.

    Well it now looks like it has sorted it's self out, all working fine now.

  • File info templates change creation date

    I created a couple of file info templates a number of years ago to apply to my pictures.
    However, whenever I apply these templates in PS (CS2, CS3 & CS4) the creation date of the photograph automatically changes to the creation date of the template!
    Is there a way of preventing this irritating problem?
    THANKS

    I created a couple of file info templates a number of years ago to apply to my pictures.
    However, whenever I apply these templates in PS (CS2, CS3 & CS4) the creation date of the photograph automatically changes to the creation date of the template!
    Is there a way of preventing this irritating problem?
    THANKS

  • I want to copy only the email address from Mail, not the name and email

    When I get an email I want to be able to copy ONLY the email address and NOT the name.
    Before I would click on an email, click on the email address and paste the email address to a list.
    Now I do that and I get the name AND the email address, which makes me edit out the name every time. UGH.
    Mavericks 10.9.5

    did not make a difference. If I copy from the email (that has a name & email) and paste to text file (Bbedit) the name and email still show. I do not want the name, just the email.

Maybe you are looking for