Relocating files based on creation date

Hello,
I have a folder full of hundreds of Video clips. I am interested in a script that will
1. look at the files sequentially
2. For each file read the creation date
3. If a Folder with that creation date does not exist, create a folder with that creation date (YYYY-MM-DD)
4. Move the file to the folder with the file's creation date
I've never used automator. Is this easy to do using that program?
The reason I want to do this is to avoid having to manually re-organize the videos by date, if I were to import the contents of the existing folder of video clips into iMovie.
Appreciate any input you can provide.
Thanks.

Automator is designed to take small, pre-written routines (actions) and string them together into a workflow. There isn't a default action to do something like this, but the Run AppleScript action can be used. Actually, an AppleScript would probably be the way to go, but I just happened to have an Automator action lying around for some reason.
Tested workflow:
1) *Ask for FInder Items* {Type: Folders}
2) *Get Folder Contents* (be careful with getting subfolders - this action will go into packages)
3) *Run AppleScript:*
<pre style="
font-family: Monaco, 'Courier New', Courier, monospace;
font-size: 10px;
font-weight: normal;
margin: 0px;
padding: 5px;
border: 1px solid #000000;
width: 720px; height: 340px;
color: #000000;
background-color: #FFEE80;
overflow: auto;"
title="this text can be pasted into an Automator 'Run AppleScript' action">
on run {input, parameters} -- create folders and move
make new folders from file creation dates (if needed), then move document files into their respective new folders
if no container is specified (missing value), the new folder will be created in the containing folder of the item
if the container is not a valid path (and not missing value), one will be asked for
input: a list of Finder items (aliases) to move
output: a list of the Finder items (aliases) moved
set output to {}
set SkippedItems to {} -- this will be a list of skipped items (errors)
set TheContainer to "" -- a Finder path to a destination folder, or missing value for the source folder
if TheContainer is not missing value then try -- check the destination path
TheContainer as alias
on error
set TheContainer to (choose folder with prompt "Where do you want to move the items?")
end try
tell application "Finder" to repeat with AnItem in the input -- step through each item in the input
if TheContainer is not missing value then -- move to the specified folder
set {class:TheClass, name:TheName, name extension:TheExtension} to item AnItem
else -- move to the source folder
set {class:TheClass, name:TheName, name extension:TheExtension, container:TheContainer} to item AnItem
end if
if TheClass is document file then try -- just documents
set TheDate to text 1 thru 10 of (creation date of AnItem as «class isot» as string) -- YYYY-MM-DD
try -- check if the target folder exists
get ("" & TheContainer & TheDate) as alias
on error -- make a new folder
make new folder at TheContainer with properties {name:TheDate}
end try
-- duplicate AnItem to the result
move AnItem to the result
set the end of output to (result as alias) -- the new file alias
on error -- permissions, etc
-- set the end of SkippedItems to (AnItem as text) -- the full path
set the end of SkippedItems to TheName -- just the name
end try
end repeat
ShowSkippedAlert for SkippedItems
return the output -- pass the result(s) to the next action
end run
to ShowSkippedAlert for SkippedItems
show an alert dialog for any items skipped, with the option to cancel the workflow
parameters - SkippedItems [list]: the items skipped
returns nothing
if SkippedItems is not {} then
set {AlertText, TheCount} to {"Error with AppleScript action", count SkippedItems}
if TheCount is greater than 1 then
set theMessage to (TheCount as text) & space & " items were skipped:"
else
set theMessage to "1 " & " item was skipped:"
end if
set {TempTID, AppleScript's text item delimiters} to {AppleScript's text item delimiters, return}
set {SkippedItems, AppleScript's text item delimiters} to {SkippedItems as text, TempTID}
if button returned of (display alert AlertText message (theMessage & return & SkippedItems) ¬
alternate button "Cancel" default button "OK") is "Cancel" then error number -128
end if
return
end ShowSkippedAlert
</pre>

Similar Messages

  • ABAP to select all AL11 files based on creation date

    Hi,
    I want to create an ABAP that can select all the files in all the subdirectory folders for a given SAP Directory. The files I want to retrieve will be based on the creation date, i.e. when the file was written to the server, it must be greater than 1 hour and less than 3 hours. The problem I have is, I don't know of any table that stores this type of information. Can any one hepl?
    Thanks, D

    Hi,
    here's a sample-prg.:
    REPORT zzzz66 .
    TABLES epsf.
    PARAMETERS dir  LIKE epsf-epsdirnam DEFAULT '/home/user1/'.
    PARAMETERS file LIKE epsf-epsfilnam DEFAULT 'file001.dat'.
    DATA mtime TYPE p DECIMALS 0.
    DATA time(10).
    DATA date LIKE sy-datum.
    CALL FUNCTION 'EPS_GET_FILE_ATTRIBUTES'
         EXPORTING
              file_name              = file
              dir_name               = dir
         IMPORTING
              file_size              = epsf-epsfilsiz
              file_owner             = epsf-epsfilown
              file_mode              = epsf-epsfilmod
              file_type              = epsf-epsfiltyp
              file_mtime             = mtime
         EXCEPTIONS
              read_directory_failed  = 1
              read_attributes_failed = 2
              OTHERS                 = 3.
    PERFORM p6_to_date_time_tz(rstr0400) USING mtime
                                               time
                                               date.
    WRITE: / mtime,
           / date, time.
    pls reward useful answers
    thank you!
    Andreas

  • How to store multiple counts based on creation date

    Hi,
    I want to retrieve the count of number of risk  for each date and render it on line graph. I am retrieving data from sharepoint list where the number of risk counts increase with its creation and decreases after it is closure which maintained in another
    column. Like if a risk is created on 02/02/2015 and closes on 03/03/2015 and an another risk is created on 17/02/2015  and closes on 14/03/2015. Then the count of the risk from 02/02/2015 to 16/02/2015 is 1 and from 17/02/2015 to 03/03/2015 is 2  and
    then again till 14/03/2015 is 1. I want to retrieve the count based on the dates rendered dynamically on X-axis that is from current date back to past 24 days. I tried to create two datasets with one storing the risks after being queried based on creation
    date and closure date and retrieving the count from Graph Y values but it is returning me count 0.
    Please help.
    Thanks in advance. 

    Hi,
    I want to retrieve the count of number of risk  for each date and render it on line graph. I am retrieving data from sharepoint list where the number of risk counts increase with its creation and decreases after it is closure which maintained in another
    column. Like if a risk is created on 02/02/2015 and closes on 03/03/2015 and an another risk is created on 17/02/2015  and closes on 14/03/2015. Then the count of the risk from 02/02/2015 to 16/02/2015 is 1 and from 17/02/2015 to 03/03/2015 is 2  and
    then again till 14/03/2015 is 1. I want to retrieve the count based on the dates rendered dynamically on X-axis that is from current date back to past 24 days. I tried to create two datasets with one storing the risks after being queried based on creation
    date and closure date and retrieving the count from Graph Y values but it is returning me count 0.
    Please help.
    Thanks in advance. 

  • Can ditto select files based on modification date?

    Hi. I'm trying to use ditto to make backups. I would like to have it select only files modified after a certain date. Is there a way to do this?
    I noticed the bom (bill of materials) option... can that be used for this purpose somehow? Not quite sure how best to create a BOM that includes only files based on modification date.
    Any suggestions? Thanks
    Eric

    ditto doesn't provide a way to select only files modified after a certain date -- but find does; see the "-newer" and "-newerXY" options. Using find, you can generate a BOM file listing files that have been modified after a certain date.
    Then you can pass that BOM file to ditto.
    Powerbook G4 1GHz   Mac OS X (10.3.9)  

  • How to List Sales Orders based on Creation Date and Delivery Priority

    Dear all,
    How can we list Sales Orders based on creation date and delivery priority.
    I tried using vl10a transaction code, but there we can see sales order based on delivery date.
    we need to list all sales order based on delivery priority and sales order creation date.
    can any one of you tell me which standard report gives such kind of report. Your suggestions will be highly appreciated.
    Thank you
    Raghu Ram

    Hi Raghu,
    There is no st report available as per your req.
    Using SQVI, you develope one report that is list of sales orders based on your req.
    SQVI is used to convert a Quick View into a query.
    Quick Viewer:
    The Quick Viewer allows you to define reports without having to program yourself. The Quick
    Viewer is especially useful for new users and occasional use.
    Quick Viewer is a tool for generating reports. SAP Query offers the user a whole range of options for defining reports. SAP Query also supports different kinds of reports such as basic lists, statistics, and ranked lists. Quick Viewer, on the other hand, is a tool that allows even relatively inexperienced users to create basic lists.
    Quick View definitions are user-dependent. You can transfer a Quick View into SAP Query in order to make reports, for example, accessible to additional users, or to use the other functions available in SAP Query.
    The following is a comparison of Quick Views and queries:
    Quick Views possess the same functional attributes as queries. However, only basic lists may be defined with Quick Views.
    In contrast to queries, no user group assignment is necessary with Quick Views. Each user has his/her own personal list of Quick Views. Quick Views cannot be exchanged between users. Quick Views may, however, be converted to queries and then be made available to other users in a specific user group.
    Info Sets are not required for Quick View definition. Whenever you define a Quick View, you can specify its data source explicitly. Tables, database views, table joins, logical databases, and even Info Sets, can all serve as data sources for a Quick View. You can only use additional tables and additional fields if you use an Info Set as a data source.
    The Quick Viewer uses various controls. Certain hardware and software requirements must also be fulfilled before you can use the Quick Viewer.
    To define a Quick View, you select certain fields according to your data source that determine the structure of your report. The report can be executed in basis mode with standard layout or may be edited using drag and drop and the other toolbox functions available in WYSIWYG mode.
    Reports created using the Quick Viewer may also be passed to external programs (Excel, for example).
    Call the Quick Viewer using System -> Services -> Quick Viewer (or transaction SQVI).
    Enter the name of the Quick View. Quick View names can contain a maximum of 14 characters.
    Choose Create.
    Enter a title for the Quick View and remarks, if you think they are relevant.
    If you do not want to base your list on a table, use the possible entries pushbutton in the Data source field to select another data source. You can choose logical databases or Info Sets. In addition, you may also create table joins. For further information, see Selecting a Data Source.
    Choose Basis mode if you want to create the list directly with no list design. Choose Layout mode if you want to define the layout of your list yourself.
    SQVI Table Quick viewer – Used to created quick client dependent reports
    Probably the easiest and most flexible way to do this is thru one of the ABAP query transactions.
    Transaction SQVI can do this and it has a very good help function that explains how it works... the drawback is that it is only for one user.
    You can play around with it and see if it meets your needs...
    The query results will come back in an ALV Grid or Excel... you can select what fields are returned, and have a selection screen to enter the search criteria.
    You can get the report by joining the tables VBAK and VBAP.
    If you have any queries, i will forward screen shots to your id.
    Reward points pls.
    Regards,
    Govind.

  • File change its creation date

    Mac OS 9 why my file change its creation date while copying now I have creation date year of 2040

    Hi, mietko -
    Not sure what might be causing that date change. As far as I know, the creation and mod dates are not in any resource fork for a file, so should be retained accurately when copied from one platform to any other.
    If you altered the file after copying it (sometimes just by opening and closing it), then a new mod date matching the date on the server could easily have been set.
    If you need to have the file have the correct creation date, you can probably use a utility such as FileBuddy to fix it.
    However, I don't know what might be causing the problem. Is this happening to only one particular file? ...or does it affect any file you copy in the same manner?

  • 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

  • Sort file based on Creation Time in Windows XP/2003

    Hi All,
    I want ot sort files in a folder based on the Creation time, not the modified time.
    We can get the creation time with dir /tc DOS command.
    Now i want to capture the output and sort it based on creation time. How i do it.Please explain with code.
    Thanks.

    Hi Aaron,
    Based on my research, these Events could be caused by the fact that you haven’t
    configured the
    security access control list (SACL) on the object that you are auditing or you have configured the SACL, but not for all the listed accesses.
    Here is a KB article below that I suggest you refer to:
    Event IDs 560 and 562 appear many times in the security event log
    http://support.microsoft.com/kb/841001/en-us
    I hope this helps.
    Best Regards,
    Amy Wang

  • Generating structured XML file based on relational data base

    Hi,
    I need to use XML DB to generate a structured XML file based on the relational oracle database. I start by using Oracle default table, emp,
    Here is EMP data,
    EMPNO ENAME DEPNO SAL
    123.00 E1 20.00 1,000.00
    124.00 E2 20.00 2,000.00
    125.00 E3 20.00 2,000.00
    126.00 E4 30.00 3,000.00
    127.00 E5 30.00 3,000.00
    128.00 E6 30.00 4,000.00
    129.00 E7 40.00 7,000.00
    I used this SQL statement to generate an XML output,
    select XMLElement ("Department",
    XMLAttributes(deptno as "DEPARTMENTNO"),
    XMLElement("EmployeeName", ename),
    XMLElement("Salary", sal)
    ) "Result"
    from
    emp
    where
    deptno=20
    The result was
    <Department DEPARTMENTNO="20">
    <EmployeeName>E1</EmployeeName>
    <Salary>1000</Salary>
    </Department>
    <Department DEPARTMENTNO="20">
    <EmployeeName>E2</EmployeeName>
    <Salary>2000</Salary>
    </Department>
    <Department DEPARTMENTNO="20">
    <EmployeeName>E3</EmployeeName>
    <Salary>2000</Salary>
    </Department>
    but I need this structure instead,
    <Department DEPARTMENTNO="20">
    <EmployeeName>E1</EmployeeName>
    <Salary>1000</Salary>
    <EmployeeName>E2</EmployeeName>
    <Salary>2000</Salary>
    <EmployeeName>E3</EmployeeName>
    <Salary>2000</Salary>
    </Department>
    Could you guide me how I can generate this kind of structure like master-detail structure and which document you recommend to obtain this point.
    Thanks,
    Shiva

    Hi,
    If you want to write an xml into file, I think you should use PL/SQL.
    Is it even possible to spool output into file without the query itself?
    doen't show me a proper xml fileTo get well-formed xml, you also have to make a root element.
    If you want <?xml version="1.0"?> also then use xmlroot(), but I haven't figure out
    how to specify the encoding.
    SQL> WITH xtab AS(SELECT 'E1' ename,20 depno,1000 sal FROM dual
      2               UNION ALL
      3               SELECT 'E2',20,2000 FROM dual
      4               UNION ALL
      5               SELECT 'E3',40,3000 FROM dual
      6               UNION ALL
      7               SELECT 'E4',30,4000 FROM dual)
      8  SELECT XMLRoot(XMLElement("Company",XMLAgg(XMLElement("Department",
      9           XMLattributes(depno as "DEPARTMENTNO"),
    10             XMLAgg(XMLForest(
    11                      ename AS "EmployeeName",
    12                      sal   AS "Salary"))))),version '1.0') company_xml
    13  FROM xtab
    14  GROUP BY depno;
    COMPANY_XML                                                                    
    <?xml version="1.0"?>                                                          
    <Company>                                                                      
      <Department DEPARTMENTNO="20">                                               
        <EmployeeName>E1</EmployeeName>                                            
        <Salary>1000</Salary>                                                      
        <EmployeeName>E2</EmployeeName>                                            
        <Salary>2000</Salary>                                                      
      </Department>                                                                
      <Department DEPARTMENTNO="30">                                               
        <EmployeeName>E4</EmployeeName>                                            
        <Salary>4000</Salary>                                                      
      </Department>                                                                
      <Department DEPARTMENTNO="40">                                               
        <EmployeeName>E3</EmployeeName>                                            
        <Salary>3000</Salary>                                                      
      </Department>                                                                
    </Company>
    [pre]                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Use files based on a date/time stamp in order

    I have a PL/SQL procedure that is using BFILE to pick-up and read a file. The file will have the same starting characters for every file followed by a date/time stamp: AAAA_09232009
    I need my procedure to use the file with the oldest date first and then rename the file after the procedure has run through it. Can anyone assist me in this? Below is the beginning of the procedure --Thanx in Advance:
    create or replace PROCEDURE XML_READ_FILE
    as
    v_bfile BFILE := BFILENAME('XML_DIR', 'AAAA_09232009.xml');
    v_clob CLOB;
    BEGIN
    DBMS_LOB.createtemporary(v_clob, TRUE);
    DBMS_LOB.OPEN(v_bfile, DBMS_LOB.lob_readonly);
    DBMS_LOB.loadfromfile(v_clob, v_bfile, DBMS_LOB.lobmaxsize);

    See if this helps:
    http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:439619916584

  • SSIS package to order all the CSV files based on their date of creation/modification mentioned in a filename and load the least recent file in oracle Destination

    HI,
    I need a help for creating SSIS package which has flat file source (specifically , delimited csv files) which are placed in a shared folder
    having file names as  File_1_2015-04-30 08:54:13.900.csv, File_2_2015-04-30 07:54:13.900.csv.
    So, I wanted to use foreach loop to find out the oldest file amongst that(through script task) and need to transform that file in Oracle Destination. After that, I want to archive that file and need to continue this action uptil the most recent file gets
    loaded in destination.
    So, Could you guys please guide me?
    Thanks in advance

    I'd say you need two loops, one to cycle through all the files and collect their names. Then sort them based on your criterion
    Perhaps you can start by seeing http://www.sqlis.com/sqlis/post/Looping-over-files-with-the-Foreach-Loop.aspx
    Collect the file names into a Recodset Destination, then shred it http://www.sqlis.com/sqlis/post/Shredding-a-Recordset.aspx
    perhaps you need an outer loop to iterate over each file to compare the files for dates.
    Do each piece and post here where you needed to stop.
    Arthur
    MyBlog
    Twitter

  • Archive/Move files based on Modified Date range to another Library Using PowerShell while retaining Metadata

    Hi,
    I am trying to archive files from a SharePoint 2010 document library by moving them to another library that's a dedicated archive/folder/library. The files to be moved are selected based on their modified date column value that should range between any time
    in the past to January 1st 2012. 
    Also, to be able to retain the tags and cloumn values after the move. Open in explorer does not bring along the user added tags.
    I tried to edit this script
    $WebURL = "http://mysite.com/";
    $ListDisplayName = "Crawl Test Library";
    $ArchiveFolderName = "Crawl Test Library Archive";
    function moveItems ()
    trap
    #make sure we dispose of these in the event of an error to avoid memory leaks:
    write-host "Error - disposing of objects...";
    $Web.Dispose();
    $Site.Dispose();
    [Microsoft.SharePoint.SPSite] $Site = New-Object Microsoft.SharePoint.SPSite($WebURL);
    [Microsoft.SharePoint.SPWeb] $Web = $Site.OpenWeb();
    [Microsoft.SharePoint.SPList] $List = $Web.Lists[$ListDisplayName];
    $FolderToMoveTo = $List.RootFolder.Url + "/" + $FolderName;
    $ItemMoveCount=0;
    $Query = New-Object Microsoft.SharePoint.SPQuery;
    $Query.Folder = $list.RootFolder;
    $camlQuery = "<Where><Leq><FieldRef Name='Modified' /><Value Type='DateTime'>2012-01-01T00:00:00Z</Value></Leq></Where>"
    $Query.Query = $camlQuery
    $Query.RowLimit = 2200; #limit query because of large folder
    $List.GetItems($Query) |
    Where {$_.ContentType.Name -ne "Folder"} |
    foreach-object {
    #Line below will simply output to console and demonstrates another .NET call
    [System.String]::format("Moving Item {0} with ID {1}...",$_.Name, $_.ID.ToString());
    $Web.GetFile($_.Url).MoveTo([System.String]::format("{0}/{1}",$FolderToMoveTo,$_.Name));
    write-host "Success...";
    $ItemMoveCount++;
    write-host "==============================================================================";
    write-host "Complete! -> Moved " $ItemMoveCount " Items to directory " $FolderName;
    write-host "==============================================================================";
    #dispose:
    $Web.Dispose();
    $Site.Dispose();
    #garbage collection
    [GC]::Collect()
    to do that but it doesn't seem to work. I am no guru in powershell yet so any help is appreciated.
    Thanks.

    This solution gets the job done. Much thanks to
    Ian Hayse
    NB...The Modified and Created dates are gonna reflect runtime dates now 
    $web = Get-SPWeb "http://sharepointed.com/"
    $list = $web.Lists["Shared Documents"]
    $spQuery = New-Object Microsoft.SharePoint.SPQuery
    $spQuery.ViewAttributes = "Scope='Recursive'";
    $spQuery.RowLimit = 2000
    $caml = '<Where><Lt><FieldRef Name="Created" /><Value IncludeTimeValue="TRUE" Type="DateTime">2014-01-01T04:06:45Z</Value></Lt></Where> '
    $spQuery.Query = $caml
    do
    $listItems = $list.GetItems($spQuery)
    $spQuery.ListItemCollectionPosition = $listItems.ListItemCollectionPosition
    $listTotal = $listItems.Count
    for ($x=$listTotal-1;$x -ge 0; $x--)
    try
    $listItems[$x].CopyTo("http://sharepoint/Docs/Documents/"+ $listItems[$x].name)
    Write-Host("DELETED: " + $listItems[$x].name)
    $listItems[$x].Recycle()
    catch
    Write-Host $_.Exception.ToString()
    while ($spQuery.ListItemCollectionPosition -ne $null)

  • Pickup the file based on the date in file name

    Dear all,
    I have requirement like this.
    EX:
    I have file name called ABC_20110721.txt , i have to pickup that file today and should not delete it and should not mark as 'Read only'. We have to keep that file as is in FTP.
    I will have another file tomorrow like ABC_20110722.txt , i have to pickup this file alone.
    So that means date in the file name is dynamic based on the system date( current date interface runs on )
    Please let me know how can we do this?
    Regards

    Hi ,
        You have not specified your operating system on which PI is running.  You need scripts to achieve this for you. In case you are using UNIX/Solaris/Linux server the following script "filename.sh" should run fine
    lines=`expr 0 + 0`
    maxlines=`expr 0 + 100`
    while [ 1 -le 5 ] ; do
         d=`date +%G%m%d`
         count=`ls -1 | grep $d |wc -l`
         c=`expr $count + 0`
         while [ $c -gt 0 ]; do
              file=`ls -1 | grep $d |tail -$c |head -1`
              searchFile=`grep $file temp | head -1 | wc -l`
              searchFile=`expr $searchFile + 0`
              if [  $searchFile -eq 0 ]; then
                   cp $file /home/anghosh0/sdn/f
                   echo $file >>temp
                   lines=`expr $lines + 1`
              fi
              c=`expr $c - 1`
         done     
         if [ $lines -gt $maxlines ]; then
                k=`date +%G%m`
              grep $k temp > t
              mv -f t temp
              lines=`expr 0 + 0`
         fi     
    done
    Say you are poutting the source files say ABC_20110721.txt,ABC_20110722.txt,ABC_20110725.txt  in a directory. Say the name of the directory is    "/usr/home/dx7" . You have to put this scipt "filename.sh" in  "usr/home/dx7".  Set the permission bits of this script to "777" or you can use command "chmod 777 filename.sh". This script will choose only the files for todays date as per server time. This script is running in an infinite loop. Thus whenever there is a new file in the directory it checks the file name, and if the name contains todays date, it puts the file in "home/anghosh0/sdn/f" directory from where PI server picks it up for reading. Please change the folder name according to your convinience. Now in the folder "/usr/home/dx7" you need to keep a file called "temp" this file will conatin only one word or any symbol say "hi". The use of temp is to collect all file names that the script has already transferred to PI folder. Thus if script has transferred file say "ABC_20110725.txt " and "DEF_20110725.txt ", then "temp" will have contents
    hi
    ABC_20110725.txt
    DEF_20110725.txt
    This prevents same file being put to PI source directory twice. Once temp reaches a maximum of 100 lines, this script clears the contents of temp automatically, except for the lines which belong to current year and current month. You can alter this value by altering the line "maxlines=`expr 0 + 100`" in the script shown above.
    This is because the file grows in length over time.Please take help of you BASIS team to put this file in correct folder and run it. It is working fine in our Linux server. Please run this as a background process with this command "filename.sh &".
    I think this will solve your problem. In case your operating system is windows then Please let me know I need to write batch file for the same.
    regards
    Anupam
    Edited by: anupamsap on Jul 26, 2011 8:18 AM

  • PowerShell Script to Delete Files Based on Current Date

    I know by using Get-Date PowerShell will look at the current date.  I would like to make a very basic PS Script which will delete a file older than 8 days based on the current day.  I believe using a if/then function will be necessary. 
    I am very new to scripting so Im not sure how the syntax is written.  All help appreciated.

    Yes, use -Recurse to get subfolders too:
    $Folder = "C:\Users\Me\Backups"
    Get-ChildItem -Path $Folder -Recurse |
    Where { $_.LastWriteTime -lt [DateTime]::Today.AddDays(-8) } |
    Sort LastWriteTime |
    Remove-Item $_ -Force -Confirm:$false
    Sam Boutros, Senior Consultant, Software Logic, KOP, PA http://superwidgets.wordpress.com (Please take a moment to Vote as Helpful and/or Mark as Answer, where applicable) _________________________________________________________________________________
    Powershell: Learn it before it's an emergency http://technet.microsoft.com/en-us/scriptcenter/powershell.aspx http://technet.microsoft.com/en-us/scriptcenter/dd793612.aspx

  • How to create pdf file based on emp data

    Hi,
    I have a table called employee having emp_no, emp_name, basic.
    I need to generate a pdf file of each individual employee for payslip purpose.
    For e.x 10000.pdf, 100001.pdf (empno.pdf)
    Each pdf file will have the payslip data of each employee like emp code, emp name, basic, DOJ etc....
    Pls help how to create this thru pl/sql.
    Thanks in advance.
    Nazar(Dubai)

    Hi Nazar,
    If you need to do this frequently for a lot of users I would recommend to consider PLPDF (http://www.plpdf.com). You can download a trial version which is restricted to 5 pages of PDF + watermark but it will allow you to test whether it does what you want to achieve.
    Thanks,
    Erik

Maybe you are looking for

  • Phone restarts when Camera is recording in flyout and back button is pressed.

    I am developing an app in which I have some tabs which are shown on every page. In one of screens I need to click a picture and I can't hide the tabs. So I created a flyout and put a captureElement and buttons to capture image in it. But when the cam

  • Auto-Increment a String of data

    OK, I see to be going round and round with the same problem. I have UDF that contains 12 digits but the first 6 digits will always be the same. The next 5 digits are the set of digits I need to auto increment The last digit is a check digit that is p

  • Problem with 8900 Browser connecting... need help

    I have a who has a 8900 and is using digicel jamaica for service.  She is able to make and receive calls.  She can receive emails but unable to get her blackberry browser to connect.  This service was working fine until this past friday.  Now she did

  • Delivery document having Zero QTY

    Dear Experts, 1) I am looking for the specific field (table-field ) through which i can find out the delivery document number having Zero QTY (for all line item) I tried all the Status (VBUK and VBUP table its not useful ) How can i find out ? 2) How

  • Is JMS designed for deadlock?

    Hi folks, Am I on crack or something, or is the JMS receive interface designed for deadlock? Here's my scenario I'm testing. 1. Fire up MQ 2. Fire up my app, which sets a listener. 3. A message comes in, onMessage gets called, and we stop at a breakp