Sorting files based on type

So I wanted to make an automator that watches a folder and when a file is added it should quickly sort it into one of my other foldrs based on its extension.so if its a pdf it should go into folder "pdf".
I thought I could be smart and instead of making a workflow for each filetype I can have automator find the extension and move the file into that extension folder.
i thought I could call an apple script that will return the extension name.
Im having trouble it wont work passed the applscript step
....anyone know what I can do?
i pass the file into my applescript:
on run {input, var1}
set var1 to (get name extension of file "input")
return var1
end run
and it says it cant get input?
Message was edited by: shamguy4

In the *Run AppleScript* action's run handler statement:on run {input, parameters}
the input parameter variable is a list of the items passed to the action, and the parameters parameter variable is a list of the parameters of the *Run AppleScript* action itself (the action's user interface - e.g. the source text of the script, if it ignores input, etc). Typically you just loop through the input list:on run {input, parameters}
repeat with anItem in the input
-- do something with the item
end repeat
return input -- or return the results of your script (for the next action)
end run

Similar Messages

  • Sorting files according to type in Pcmanfm is not working properly.

    Hi,
    For a long time I just ignored this fact, but as now I'm trying to make everything work as it should, my problem with Pcmanfm bothers me more and more. I would like to sort files according to their types. Nothing easier, right? So I chose "Sort by type" option and got this - (1).
    As you can see, the files are not in the alphabetical order as they should (but are sorted by type) But, when I click on View menu (Widok on the screenshot - (2)) the files jump back to their original, alphabetical order, still being grouped according to types (3).
    Anyone encountered such a problem before? Tried to find something familiar with no results. I'm using FAM with Pcmanfm, maybe there lies the source of my problems?
    I'll provide every information you might need, just ask.

    Hm, so it seems that the problem is on Pcmanfm's side. Thank you skottish (once again), let's hope that this will be solved somehow.
    Ranguvar wrote:I'm an idiot, it appears there's a bug with Gamin and PCManFM. Sorry!
    Really? Didn't know about it, really :roll:

  • 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

  • Sorting files based on location

    is this possible?
    i have files on an internal and external all in different folders. can i sort based on the folder?

    If you look in View > Options you will see a big list of all the things that iTunes can display and sort on. iTunes can sort on almost anything. Except folder.

  • Sorting incoming files based on payload content

    Hi,
      I have a file>XI-> FILE scenario...I need to sort the incoming file based on payload content...But my understanding is in XI each line item would be processed one at a time...Is it possible to sort the entire file before beginning to process???
    -Ken

    Hi Ken,
    you can try to create generic content sorting with java mapping:
    /people/ravikumar.allampallam/blog/2005/06/24/convert-any-flat-file-to-any-idoc-java-mapping
    Regards,
    michal

  • Receiving an export file error: wrong type

    I have created a movie several times in FCP and then exported the movie to QT without any problems. Now all of a sudden, I can't get the movie to export correctly. After the 2 hour export, I'll check on FCP to find that the program has shut down without an "Unexpected Shut Down" message. I check for the exported movie which I find in the saved folder. I click to open and verify the completed job, but find that I get an error instead : "Error: Wrong Type".
    The last successful movie I created was September 14th, prior to the QT 7.5.5 upgrade. I thought it was the upgrade, as I found out that FCP does not do well with the new QT version, so I reverted to QT 7.5, but I am still experiencing the same problem with FCP quitting and the movie not being able to read.
    What is going on? Can anyone help?

    Francois:
    This is a crazy solution, but this happened to me last week and this solution enabled me to open my files again -- they were all greyed out and I thought I'd lost them. I took my drive in to an Apple Store Genius Bar without resolution and spend 2 hours online with ProApps (FCE/FCP) tech support, also with no resolution.
    This fix is based on the fact that FCP when it is started, it automatically opens the project that was open when it was closed. First, in FCP save the current project (this can be any project -- I created a placeholder project -- to a dummy name -- I used "save me". Close FCP and delete the dummy name ("save me") project. Now rename the project that is greyed out and provides the File Error: Wrong Type message that you would like to open to the dummy name, so that it's now called "save me". Now open FCP again. Now save the recuperated file using the original name.
    Maarten
    Here's what you do.

  • Problem when sorting data based on date

    I am trying to sort the following data based on the Transaction Receipt date column,unable to do it usi g the following syntax:
    <?sort:TRANSACTION_RECEIPT_DATE;'ascending';data-type='date'?>
    I have problem in converting the date in report to canonical date ,is there any other way to achieve the output without converting the date format.
    <?xml version="1.0"?>
    <!-- Generated by Oracle Reports version 6.0.8.27.0 -->
    <RECDTREP>
    <LIST_G_ASW_REC_DATE>
    <G_ASW_REC_DATE>
    <SNO_CREATED_BY>1433</SNO_CREATED_BY>
    <SNO_REQUEST_ID>-1</SNO_REQUEST_ID>
    <VENDOR_LOT_NUM>PO104</VENDOR_LOT_NUM>
    <SNO_CREATION_DATE>07-APR-09</SNO_CREATION_DATE>
    <SNO_ATTRIBUTE1></SNO_ATTRIBUTE1>
    <OBJECT_ID>24636</OBJECT_ID>
    <INITIALIZATION_DATE>07-APR-09</INITIALIZATION_DATE>
    <ORGANIZATION_CODE>10</ORGANIZATION_CODE>
    <ORGANISATION_NAME>NDC - PARTS</ORGANISATION_NAME>
    <SERIAL_NUMBER>6510863063</SERIAL_NUMBER>
    <ITEM_CODE>3000.006</ITEM_CODE>
    <DESCRIPTION>ALLISON 3000 SERIES ON HWY TRANSMISSION E016392</DESCRIPTION>
    <MANUFACTURER>ALLISON</MANUFACTURER>
    <APPLICATION>On Highway</APPLICATION>
    <ITEM_COST>8879.02</ITEM_COST>
    <MATERIAL_COST>631.09</MATERIAL_COST>
    <CURRENCY_CODE>AUD</CURRENCY_CODE>
    <PO_UNIT_PRICE></PO_UNIT_PRICE>
    <TRANSACTION_RECEIPT_DATE>07-Apr-09</TRANSACTION_RECEIPT_DATE>
    <PO_NUMBER>982121</PO_NUMBER>
    </G_ASW_REC_DATE>
    <G_ASW_REC_DATE>
    <SNO_CREATED_BY>1433</SNO_CREATED_BY>
    <SNO_REQUEST_ID>-1</SNO_REQUEST_ID>
    <VENDOR_LOT_NUM>PO107</VENDOR_LOT_NUM>
    <SNO_CREATION_DATE>07-APR-09</SNO_CREATION_DATE>
    <SNO_ATTRIBUTE1></SNO_ATTRIBUTE1>
    <OBJECT_ID>24641</OBJECT_ID>
    <INITIALIZATION_DATE>07-APR-09</INITIALIZATION_DATE>
    <ORGANIZATION_CODE>10</ORGANIZATION_CODE>
    <ORGANISATION_NAME>NDC - PARTS</ORGANISATION_NAME>
    <SERIAL_NUMBER>6510863068</SERIAL_NUMBER>
    <ITEM_CODE>3000.006</ITEM_CODE>
    <DESCRIPTION>ALLISON 3000 SERIES ON HWY TRANSMISSION E016392</DESCRIPTION>
    <MANUFACTURER>ALLISON</MANUFACTURER>
    <APPLICATION>On Highway</APPLICATION>
    <ITEM_COST>8879.02</ITEM_COST>
    <MATERIAL_COST>631.09</MATERIAL_COST>
    <CURRENCY_CODE>AUD</CURRENCY_CODE>
    <PO_UNIT_PRICE></PO_UNIT_PRICE>
    <TRANSACTION_RECEIPT_DATE>07-Apr-09</TRANSACTION_RECEIPT_DATE>
    <PO_NUMBER>982121</PO_NUMBER>
    </G_ASW_REC_DATE>
    <G_ASW_REC_DATE>
    <SNO_CREATED_BY>1433</SNO_CREATED_BY>
    <SNO_REQUEST_ID>-1</SNO_REQUEST_ID>
    <VENDOR_LOT_NUM>PO123</VENDOR_LOT_NUM>
    <SNO_CREATION_DATE>07-APR-09</SNO_CREATION_DATE>
    <SNO_ATTRIBUTE1>2008/06/11 00:00:00</SNO_ATTRIBUTE1>
    <OBJECT_ID>24658</OBJECT_ID>
    <INITIALIZATION_DATE>07-APR-09</INITIALIZATION_DATE>
    <ORGANIZATION_CODE>10</ORGANIZATION_CODE>
    <ORGANISATION_NAME>NDC - PARTS</ORGANISATION_NAME>
    <SERIAL_NUMBER>6510863086</SERIAL_NUMBER>
    <ITEM_CODE>3000.006</ITEM_CODE>
    <DESCRIPTION>ALLISON 3000 SERIES ON HWY TRANSMISSION E016392</DESCRIPTION>
    <MANUFACTURER>ALLISON</MANUFACTURER>
    <APPLICATION>On Highway</APPLICATION>
    <ITEM_COST>8879.02</ITEM_COST>
    <MATERIAL_COST>631.09</MATERIAL_COST>
    <CURRENCY_CODE>AUD</CURRENCY_CODE>
    <PO_UNIT_PRICE></PO_UNIT_PRICE>
    <TRANSACTION_RECEIPT_DATE>07-Apr-09</TRANSACTION_RECEIPT_DATE>
    <PO_NUMBER>982121</PO_NUMBER>
    </G_ASW_REC_DATE>
    <G_ASW_REC_DATE>
    <SNO_CREATED_BY>1433</SNO_CREATED_BY>
    <SNO_REQUEST_ID>-1</SNO_REQUEST_ID>
    <VENDOR_LOT_NUM>PO75</VENDOR_LOT_NUM>
    <SNO_CREATION_DATE>31-MAR-09</SNO_CREATION_DATE>
    <SNO_ATTRIBUTE1></SNO_ATTRIBUTE1>
    <OBJECT_ID>22190</OBJECT_ID>
    <INITIALIZATION_DATE>14-APR-09</INITIALIZATION_DATE>
    <ORGANIZATION_CODE>10</ORGANIZATION_CODE>
    <ORGANISATION_NAME>NDC - PARTS</ORGANISATION_NAME>
    <SERIAL_NUMBER>6510860842</SERIAL_NUMBER>
    <ITEM_CODE>3000.006</ITEM_CODE>
    <DESCRIPTION>ALLISON 3000 SERIES ON HWY TRANSMISSION E016392</DESCRIPTION>
    <MANUFACTURER>ALLISON</MANUFACTURER>
    <APPLICATION>On Highway</APPLICATION>
    <ITEM_COST>8879.02</ITEM_COST>
    <MATERIAL_COST>631.09</MATERIAL_COST>
    <CURRENCY_CODE>AUD</CURRENCY_CODE>
    <PO_UNIT_PRICE></PO_UNIT_PRICE>
    <TRANSACTION_RECEIPT_DATE>31-Mar-09</TRANSACTION_RECEIPT_DATE>
    <PO_NUMBER>971515</PO_NUMBER>
    </G_ASW_REC_DATE>
    <G_ASW_REC_DATE>
    <SNO_CREATED_BY>1433</SNO_CREATED_BY>
    <SNO_REQUEST_ID>-1</SNO_REQUEST_ID>
    <VENDOR_LOT_NUM>PO116</VENDOR_LOT_NUM>
    <SNO_CREATION_DATE>25-JUN-09</SNO_CREATION_DATE>
    <SNO_ATTRIBUTE1>2008/06/11 00:00:00</SNO_ATTRIBUTE1>
    <OBJECT_ID>64271</OBJECT_ID>
    <INITIALIZATION_DATE>30-JUN-09</INITIALIZATION_DATE>
    <ORGANIZATION_CODE>10</ORGANIZATION_CODE>
    <ORGANISATION_NAME>NDC - PARTS</ORGANISATION_NAME>
    <SERIAL_NUMBER>6510863077</SERIAL_NUMBER>
    <ITEM_CODE>3000.006</ITEM_CODE>
    <DESCRIPTION>ALLISON 3000 SERIES ON HWY TRANSMISSION E016392</DESCRIPTION>
    <MANUFACTURER>ALLISON</MANUFACTURER>
    <APPLICATION>On Highway</APPLICATION>
    <ITEM_COST>8879.02</ITEM_COST>
    <MATERIAL_COST>631.09</MATERIAL_COST>
    <CURRENCY_CODE>AUD</CURRENCY_CODE>
    <PO_UNIT_PRICE></PO_UNIT_PRICE>
    <TRANSACTION_RECEIPT_DATE>25-Jun-09</TRANSACTION_RECEIPT_DATE>
    <PO_NUMBER>982121</PO_NUMBER>
    </G_ASW_REC_DATE>
    <G_ASW_REC_DATE>
    <SNO_CREATED_BY>1433</SNO_CREATED_BY>
    <SNO_REQUEST_ID>-1</SNO_REQUEST_ID>
    <VENDOR_LOT_NUM>PO92</VENDOR_LOT_NUM>
    <SNO_CREATION_DATE>31-MAR-09</SNO_CREATION_DATE>
    <SNO_ATTRIBUTE1>2008/06/11 00:00:00</SNO_ATTRIBUTE1>
    <OBJECT_ID>22253</OBJECT_ID>
    <INITIALIZATION_DATE>14-APR-09</INITIALIZATION_DATE>
    <ORGANIZATION_CODE>10</ORGANIZATION_CODE>
    <ORGANISATION_NAME>NDC - PARTS</ORGANISATION_NAME>
    <SERIAL_NUMBER>6510860890</SERIAL_NUMBER>
    <ITEM_CODE>3000.006</ITEM_CODE>
    <DESCRIPTION>ALLISON 3000 SERIES ON HWY TRANSMISSION E016392</DESCRIPTION>
    <MANUFACTURER>ALLISON</MANUFACTURER>
    <APPLICATION>On Highway</APPLICATION>
    <ITEM_COST>8879.02</ITEM_COST>
    <MATERIAL_COST>631.09</MATERIAL_COST>
    <CURRENCY_CODE>AUD</CURRENCY_CODE>
    <PO_UNIT_PRICE></PO_UNIT_PRICE>
    <TRANSACTION_RECEIPT_DATE>31-Mar-09</TRANSACTION_RECEIPT_DATE>
    <PO_NUMBER>971515</PO_NUMBER>
    </G_ASW_REC_DATE>
    <G_ASW_REC_DATE>
    <SNO_CREATED_BY>1433</SNO_CREATED_BY>
    <SNO_REQUEST_ID>-1</SNO_REQUEST_ID>
    <VENDOR_LOT_NUM>PO99</VENDOR_LOT_NUM>
    <SNO_CREATION_DATE>31-MAR-09</SNO_CREATION_DATE>
    <SNO_ATTRIBUTE1></SNO_ATTRIBUTE1>
    <OBJECT_ID>22263</OBJECT_ID>
    <INITIALIZATION_DATE>14-APR-09</INITIALIZATION_DATE>
    <ORGANIZATION_CODE>10</ORGANIZATION_CODE>
    <ORGANISATION_NAME>NDC - PARTS</ORGANISATION_NAME>
    <SERIAL_NUMBER>6510860899</SERIAL_NUMBER>
    <ITEM_CODE>3000.006</ITEM_CODE>
    <DESCRIPTION>ALLISON 3000 SERIES ON HWY TRANSMISSION E016392</DESCRIPTION>
    <MANUFACTURER>ALLISON</MANUFACTURER>
    <APPLICATION>On Highway</APPLICATION>
    <ITEM_COST>8879.02</ITEM_COST>
    <MATERIAL_COST>631.09</MATERIAL_COST>
    <CURRENCY_CODE>AUD</CURRENCY_CODE>
    <PO_UNIT_PRICE></PO_UNIT_PRICE>
    <TRANSACTION_RECEIPT_DATE>31-Mar-09</TRANSACTION_RECEIPT_DATE>
    <PO_NUMBER>971515</PO_NUMBER>
    </G_ASW_REC_DATE>
    <G_ASW_REC_DATE>
    <SNO_CREATED_BY>1433</SNO_CREATED_BY>
    <SNO_REQUEST_ID>-1</SNO_REQUEST_ID>
    <VENDOR_LOT_NUM>PO109</VENDOR_LOT_NUM>
    <SNO_CREATION_DATE>25-JUN-09</SNO_CREATION_DATE>
    <SNO_ATTRIBUTE1></SNO_ATTRIBUTE1>
    <OBJECT_ID>64204</OBJECT_ID>
    <INITIALIZATION_DATE>30-JUN-09</INITIALIZATION_DATE>
    <ORGANIZATION_CODE>10</ORGANIZATION_CODE>
    <ORGANISATION_NAME>NDC - PARTS</ORGANISATION_NAME>
    <SERIAL_NUMBER>6510863070</SERIAL_NUMBER>
    <ITEM_CODE>3000.006</ITEM_CODE>
    <DESCRIPTION>ALLISON 3000 SERIES ON HWY TRANSMISSION E016392</DESCRIPTION>
    <MANUFACTURER>ALLISON</MANUFACTURER>
    <APPLICATION>On Highway</APPLICATION>
    <ITEM_COST>8879.02</ITEM_COST>
    <MATERIAL_COST>631.09</MATERIAL_COST>
    <CURRENCY_CODE>AUD</CURRENCY_CODE>
    <PO_UNIT_PRICE></PO_UNIT_PRICE>
    <TRANSACTION_RECEIPT_DATE>25-Jun-09</TRANSACTION_RECEIPT_DATE>
    <PO_NUMBER>982121</PO_NUMBER>
    </G_ASW_REC_DATE>
    <G_ASW_REC_DATE>
    <SNO_CREATED_BY>1433</SNO_CREATED_BY>
    <SNO_REQUEST_ID>-1</SNO_REQUEST_ID>
    <VENDOR_LOT_NUM>PO135</VENDOR_LOT_NUM>
    <SNO_CREATION_DATE>25-JUN-09</SNO_CREATION_DATE>
    <SNO_ATTRIBUTE1>2008/06/18 00:00:00</SNO_ATTRIBUTE1>
    <OBJECT_ID>64296</OBJECT_ID>
    <INITIALIZATION_DATE>30-JUN-09</INITIALIZATION_DATE>
    <ORGANIZATION_CODE>10</ORGANIZATION_CODE>
    <ORGANISATION_NAME>NDC - PARTS</ORGANISATION_NAME>
    <SERIAL_NUMBER>6510875546</SERIAL_NUMBER>
    <ITEM_CODE>3000.006</ITEM_CODE>
    <DESCRIPTION>ALLISON 3000 SERIES ON HWY TRANSMISSION E016392</DESCRIPTION>
    <MANUFACTURER>ALLISON</MANUFACTURER>
    <APPLICATION>On Highway</APPLICATION>
    <ITEM_COST>8879.02</ITEM_COST>
    <MATERIAL_COST>631.09</MATERIAL_COST>
    <CURRENCY_CODE>AUD</CURRENCY_CODE>
    <PO_UNIT_PRICE></PO_UNIT_PRICE>
    <TRANSACTION_RECEIPT_DATE>25-Jun-09</TRANSACTION_RECEIPT_DATE>
    <PO_NUMBER>982121</PO_NUMBER>
    </G_ASW_REC_DATE>
    <G_ASW_REC_DATE>
    <SNO_CREATED_BY>1433</SNO_CREATED_BY>
    <SNO_REQUEST_ID>-1</SNO_REQUEST_ID>
    <VENDOR_LOT_NUM>PO101</VENDOR_LOT_NUM>
    <SNO_CREATION_DATE>07-APR-09</SNO_CREATION_DATE>
    <SNO_ATTRIBUTE1></SNO_ATTRIBUTE1>
    <OBJECT_ID>24618</OBJECT_ID>
    <INITIALIZATION_DATE>07-APR-09</INITIALIZATION_DATE>
    <ORGANIZATION_CODE>10</ORGANIZATION_CODE>
    <ORGANISATION_NAME>NDC - PARTS</ORGANISATION_NAME>
    <SERIAL_NUMBER>6510863046</SERIAL_NUMBER>
    <ITEM_CODE>3000.006</ITEM_CODE>
    <DESCRIPTION>ALLISON 3000 SERIES ON HWY TRANSMISSION E016392</DESCRIPTION>
    <MANUFACTURER>ALLISON</MANUFACTURER>
    <APPLICATION>On Highway</APPLICATION>
    <ITEM_COST>8879.02</ITEM_COST>
    <MATERIAL_COST>631.09</MATERIAL_COST>
    <CURRENCY_CODE>AUD</CURRENCY_CODE>
    <PO_UNIT_PRICE></PO_UNIT_PRICE>
    <TRANSACTION_RECEIPT_DATE>07-Apr-09</TRANSACTION_RECEIPT_DATE>
    <PO_NUMBER>982121</PO_NUMBER>
    </G_ASW_REC_DATE>
    <G_ASW_REC_DATE>
    <SNO_CREATED_BY>1433</SNO_CREATED_BY>
    <SNO_REQUEST_ID>-1</SNO_REQUEST_ID>
    <VENDOR_LOT_NUM>PO120</VENDOR_LOT_NUM>
    <SNO_CREATION_DATE>07-APR-09</SNO_CREATION_DATE>
    <SNO_ATTRIBUTE1>2008/06/11 00:00:00</SNO_ATTRIBUTE1>
    <OBJECT_ID>24653</OBJECT_ID>
    <INITIALIZATION_DATE>07-APR-09</INITIALIZATION_DATE>
    <ORGANIZATION_CODE>10</ORGANIZATION_CODE>
    <ORGANISATION_NAME>NDC - PARTS</ORGANISATION_NAME>
    <SERIAL_NUMBER>6510863081</SERIAL_NUMBER>
    <ITEM_CODE>3000.006</ITEM_CODE>
    <DESCRIPTION>ALLISON 3000 SERIES ON HWY TRANSMISSION E016392</DESCRIPTION>
    <MANUFACTURER>ALLISON</MANUFACTURER>
    <APPLICATION>On Highway</APPLICATION>
    <ITEM_COST>8879.02</ITEM_COST>
    <MATERIAL_COST>631.09</MATERIAL_COST>
    <CURRENCY_CODE>AUD</CURRENCY_CODE>
    <PO_UNIT_PRICE></PO_UNIT_PRICE>
    <TRANSACTION_RECEIPT_DATE>07-Apr-09</TRANSACTION_RECEIPT_DATE>
    <PO_NUMBER>982121</PO_NUMBER>
    </G_ASW_REC_DATE>
    <G_ASW_REC_DATE>
    <SNO_CREATED_BY>1433</SNO_CREATED_BY>
    <SNO_REQUEST_ID>-1</SNO_REQUEST_ID>
    <VENDOR_LOT_NUM>PO122</VENDOR_LOT_NUM>
    <SNO_CREATION_DATE>07-APR-09</SNO_CREATION_DATE>
    <SNO_ATTRIBUTE1>2008/06/11 00:00:00</SNO_ATTRIBUTE1>
    <OBJECT_ID>24657</OBJECT_ID>
    <INITIALIZATION_DATE>07-APR-09</INITIALIZATION_DATE>
    <ORGANIZATION_CODE>10</ORGANIZATION_CODE>
    <ORGANISATION_NAME>NDC - PARTS</ORGANISATION_NAME>
    <SERIAL_NUMBER>6510863085</SERIAL_NUMBER>
    <ITEM_CODE>3000.006</ITEM_CODE>
    <DESCRIPTION>ALLISON 3000 SERIES ON HWY TRANSMISSION E016392</DESCRIPTION>
    <MANUFACTURER>ALLISON</MANUFACTURER>
    <APPLICATION>On Highway</APPLICATION>
    <ITEM_COST>8879.02</ITEM_COST>
    <MATERIAL_COST>631.09</MATERIAL_COST>
    <CURRENCY_CODE>AUD</CURRENCY_CODE>
    <PO_UNIT_PRICE></PO_UNIT_PRICE>
    <TRANSACTION_RECEIPT_DATE>07-Apr-09</TRANSACTION_RECEIPT_DATE>
    <PO_NUMBER>982121</PO_NUMBER>
    </G_ASW_REC_DATE>
    <G_ASW_REC_DATE>
    <SNO_CREATED_BY>1433</SNO_CREATED_BY>
    <SNO_REQUEST_ID>-1</SNO_REQUEST_ID>
    <VENDOR_LOT_NUM>PO127</VENDOR_LOT_NUM>
    <SNO_CREATION_DATE>07-APR-09</SNO_CREATION_DATE>
    <SNO_ATTRIBUTE1>2008/06/11 00:00:00</SNO_ATTRIBUTE1>
    <OBJECT_ID>24662</OBJECT_ID>
    <INITIALIZATION_DATE>07-APR-09</INITIALIZATION_DATE>
    <ORGANIZATION_CODE>10</ORGANIZATION_CODE>
    <ORGANISATION_NAME>NDC - PARTS</ORGANISATION_NAME>
    <SERIAL_NUMBER>6510863090</SERIAL_NUMBER>
    <ITEM_CODE>3000.006</ITEM_CODE>
    <DESCRIPTION>ALLISON 3000 SERIES ON HWY TRANSMISSION E016392</DESCRIPTION>
    <MANUFACTURER>ALLISON</MANUFACTURER>
    <APPLICATION>On Highway</APPLICATION>
    <ITEM_COST>8879.02</ITEM_COST>
    <MATERIAL_COST>631.09</MATERIAL_COST>
    <CURRENCY_CODE>AUD</CURRENCY_CODE>
    <PO_UNIT_PRICE></PO_UNIT_PRICE>
    <TRANSACTION_RECEIPT_DATE>07-Apr-09</TRANSACTION_RECEIPT_DATE>
    <PO_NUMBER>982121</PO_NUMBER>
    </G_ASW_REC_DATE>
    <G_ASW_REC_DATE>
    <SNO_CREATED_BY>1433</SNO_CREATED_BY>
    <SNO_REQUEST_ID>-1</SNO_REQUEST_ID>
    <VENDOR_LOT_NUM>PO100</VENDOR_LOT_NUM>
    <SNO_CREATION_DATE>07-APR-09</SNO_CREATION_DATE>
    <SNO_ATTRIBUTE1></SNO_ATTRIBUTE1>
    <OBJECT_ID>24585</OBJECT_ID>
    <INITIALIZATION_DATE>07-APR-09</INITIALIZATION_DATE>
    <ORGANIZATION_CODE>10</ORGANIZATION_CODE>
    <ORGANISATION_NAME>NDC - PARTS</ORGANISATION_NAME>
    <SERIAL_NUMBER>6510863033</SERIAL_NUMBER>
    <ITEM_CODE>3000.006</ITEM_CODE>
    <DESCRIPTION>ALLISON 3000 SERIES ON HWY TRANSMISSION E016392</DESCRIPTION>
    <MANUFACTURER>ALLISON</MANUFACTURER>
    <APPLICATION>On Highway</APPLICATION>
    <ITEM_COST>8879.02</ITEM_COST>
    <MATERIAL_COST>631.09</MATERIAL_COST>
    <CURRENCY_CODE>AUD</CURRENCY_CODE>
    <PO_UNIT_PRICE></PO_UNIT_PRICE>
    <TRANSACTION_RECEIPT_DATE>07-Apr-09</TRANSACTION_RECEIPT_DATE>
    <PO_NUMBER>982121</PO_NUMBER>
    </G_ASW_REC_DATE>
    <G_ASW_REC_DATE>
    <SNO_CREATED_BY>1433</SNO_CREATED_BY>
    <SNO_REQUEST_ID>-1</SNO_REQUEST_ID>
    <VENDOR_LOT_NUM>PO110</VENDOR_LOT_NUM>
    <SNO_CREATION_DATE>25-JUN-09</SNO_CREATION_DATE>
    <SNO_ATTRIBUTE1>2008/06/11 00:00:00</SNO_ATTRIBUTE1>
    <OBJECT_ID>64265</OBJECT_ID>
    <INITIALIZATION_DATE>30-JUN-09</INITIALIZATION_DATE>
    <ORGANIZATION_CODE>10</ORGANIZATION_CODE>
    <ORGANISATION_NAME>NDC - PARTS</ORGANISATION_NAME>
    <SERIAL_NUMBER>6510863071</SERIAL_NUMBER>
    <ITEM_CODE>3000.006</ITEM_CODE>
    <DESCRIPTION>ALLISON 3000 SERIES ON HWY TRANSMISSION E016392</DESCRIPTION>
    <MANUFACTURER>ALLISON</MANUFACTURER>
    <APPLICATION>On Highway</APPLICATION>
    <ITEM_COST>8879.02</ITEM_COST>
    <MATERIAL_COST>631.09</MATERIAL_COST>
    <CURRENCY_CODE>AUD</CURRENCY_CODE>
    <PO_UNIT_PRICE></PO_UNIT_PRICE>
    <TRANSACTION_RECEIPT_DATE>25-Jun-09</TRANSACTION_RECEIPT_DATE>
    <PO_NUMBER>982121</PO_NUMBER>
    </G_ASW_REC_DATE>
    <G_ASW_REC_DATE>
    <SNO_CREATED_BY>1433</SNO_CREATED_BY>
    <SNO_REQUEST_ID>-1</SNO_REQUEST_ID>
    <VENDOR_LOT_NUM>PO130</VENDOR_LOT_NUM>
    <SNO_CREATION_DATE>25-JUN-09</SNO_CREATION_DATE>
    <SNO_ATTRIBUTE1>2008/06/13 00:00:00</SNO_ATTRIBUTE1>
    <OBJECT_ID>64275</OBJECT_ID>
    <INITIALIZATION_DATE>30-JUN-09</INITIALIZATION_DATE>
    <ORGANIZATION_CODE>10</ORGANIZATION_CODE>
    <ORGANISATION_NAME>NDC - PARTS</ORGANISATION_NAME>
    <SERIAL_NUMBER>6510875487</SERIAL_NUMBER>
    <ITEM_CODE>3000.006</ITEM_CODE>
    <DESCRIPTION>ALLISON 3000 SERIES ON HWY TRANSMISSION E016392</DESCRIPTION>
    <MANUFACTURER>ALLISON</MANUFACTURER>
    <APPLICATION>On Highway</APPLICATION>
    <ITEM_COST>8879.02</ITEM_COST>
    <MATERIAL_COST>631.09</MATERIAL_COST>
    <CURRENCY_CODE>AUD</CURRENCY_CODE>
    <PO_UNIT_PRICE></PO_UNIT_PRICE>
    <TRANSACTION_RECEIPT_DATE>25-Jun-09</TRANSACTION_RECEIPT_DATE>
    <PO_NUMBER>982121</PO_NUMBER>
    </G_ASW_REC_DATE>
    </LIST_G_ASW_REC_DATE>
    <CF_SORT_BY>Manufacture,Receipt Date,Organization,Item Code</CF_SORT_BY>
    <CF_SERIAL_WHERE></CF_SERIAL_WHERE>
    </RECDTREP>

    HI Mahesh,
    <TRANSACTION_RECEIPT_DATE>07-Apr-09</TRANSACTION_RECEIPT_DATE>
    this is not a date,
    so you should change the query to get you the format in xsd format : YYYY-MM-DDThh:mm:ss+HH:MM
    otherwise, you have to write a custom sort function to decode and order it it.
    if you dont do the custom order and use
    <?sort:TRANSACTION_RECEIPT_DATE;'ascending';data-type='date'?>
    the data will be treated as string and you will see the row is sorted on string.

  • N9 Photo Gallery sort order - based on what?

    Hello,
    I am thrilled with my N9, but have one problem: I want to use the phone to keep not only photos made with it. I therefore saved extra photos in the Pictures folder. They appear in the gallery, but in a weird order, not based on either the name, EXIF date, modification date or creation date. Is there a possibility to sort them on either of these? All I want is to control the sort order. After all, it is MY gallery...
    On my previous phone (N8) sorting was based on the last modification date. Also not optimal (EXIF date would have been perfect) but still controllable.
    Solved!
    Go to Solution.

    Well, maybe those pictures were never edited outside the phone, I don't know.
    Anyway, I believe I found the explanation: I exported the photos from Picasa, maxing them to a resolution of 1600xXXX. This way all files were created... today. Nevertheless the EXIF information is correctly saved by Picasa, so Date Image Taken was preserved. Although I modified in all files the creation date to be equal to EXIF Date Image Taken (ACDSee/batch/AdjustTimeStamp) , and then also renamed all pictures based on that, the "new" creation date still remains saved somewhere in the picture files and the Gallery sorts the pictures on it! The pictures were sorted in the reversed order I exported them from Picasa... Bad.
    Anyway, since this is not a request forum, it would be futile to say (again) that Nokia should use the EXIF Date Picture Taken for picture sorting. So I don't say it (!).

  • Logon Error in importing XML file by import type - Schema in import Manager

    Hi,
    I am trying to import the xml file by selecting type XML Schema. I have already created an XML Schema in console  based on the XSD file from my desktop and the same is visible in dropdown of XML Schema Tab while importing.
    But I am not able to import the XML file based on the XML Schema. I got the Logon Error As : "Cannot load XML file"
    Content of the error is like -
    (Error:
    Commerror80004005 Unsepcified error
    Source=mdxml4.dll    Description= file:///C:/DOCUM...............
    The Namespace provided Differs from the schema's 'http://n............)
    Please have you inputs as this is a very critical requirement to pull the XML file based on XML schema automatically based on the ports created in console.
    Response wud be highly appreciated.
    Thanks & Rgds/Pawan

    Hi Jason,
    Thanks for your response!
    I don't mind you in taking my thread to core MDM stuff. It would be big relief for to have an response on my query.
    Actually this is a problem with respect to SRM MDM Catalog.....
    I am waiting see the following response threads based on my query..
    Thanks once again!
    Best Rgds/Pawan

  • SAP PI 7.3.1 File Adapter - Select file based on content

    Hi all,
    I have a scenario where I need to process a file differently based on the content within the payload.
    For example a file called File_IS,xml is sent to a folder that PI is polling. Within this file is a field <TYPE> which I want to use to determine whether the file should be used  . I have two mapping scenarios that each have a file sender communication channel polling for the same file name "File_IS.xml" .  This is because a message will come from a 3rd party with the same file name but the content can be different meaning different mapping scenarios are required.  IF Com_Channel_1 sees the File I only want it to be picked up if say <TYPE> = 'A' - if not then Com_Channel_1 should do nothing with this file.  Similarly Com_Channel_2 should only use the file if <Type> = 'B'. 
    Scenario:
    File_IS.xml       -> File sender 1  -> <TYPE> = 'A'  - Pick up file - do mapping - archive.  <TYPE> <> 'A' - do nothing and leave file in folder
                          ->  File sender 2  -> <TYPE> = 'B'  - Pick up file - do mapping - archive.  <TYPE> <> 'B' - do nothing and leave file in folder
    Is the above possible at all ?
    Thanks for your time.
    Best Regards.
    Gary

    Hello,
    In case content of input files are different (for both the scenarios) even then also u can use one file sender channel. Check below approach:
    Interface Determination condition
    Thanks
    Amit Srivastava

  • File Based Multithreaded Web Server Question

    Hi friends,
    I have the code of a simple File Based Multithreaded Web Server. I have been asked to add proper http/1.1 Keep-Alive behavior to it. As far as I understand it means to use the same socket for the request coming from the same client without opening a new socket for every request by it. I am unable to implement it. Any help would be greatly appreciated. The entire code is as below:
    package multithreadedwebserver.com;
    import java.io.*;
    import java.net.*;
    import java.util.*;
    /** This Class declares the general and HTTP constants
    * and defines general static methods:
    class Constants {
    /** 2XX: generally "OK" */
    public static final int HTTP_OK = 200;
    public static final int HTTP_CREATED = 201;
    public static final int HTTP_ACCEPTED = 202;
    public static final int HTTP_NOT_AUTHORITATIVE = 203;
    public static final int HTTP_NO_CONTENT = 204;
    public static final int HTTP_RESET = 205;
    public static final int HTTP_PARTIAL = 206;
    /** 3XX: relocation/redirect */
    public static final int HTTP_MULT_CHOICE = 300;
    public static final int HTTP_MOVED_PERM = 301;
    public static final int HTTP_MOVED_TEMP = 302;
    public static final int HTTP_SEE_OTHER = 303;
    public static final int HTTP_NOT_MODIFIED = 304;
    public static final int HTTP_USE_PROXY = 305;
    /** 4XX: client error */
    public static final int HTTP_BAD_REQUEST = 400;
    public static final int HTTP_UNAUTHORIZED = 401;
    public static final int HTTP_PAYMENT_REQUIRED = 402;
    public static final int HTTP_FORBIDDEN = 403;
    public static final int HTTP_NOT_FOUND = 404;
    public static final int HTTP_BAD_METHOD = 405;
    public static final int HTTP_NOT_ACCEPTABLE = 406;
    public static final int HTTP_PROXY_AUTH = 407;
    public static final int HTTP_CLIENT_TIMEOUT = 408;
    public static final int HTTP_CONFLICT = 409;
    public static final int HTTP_GONE = 410;
    public static final int HTTP_LENGTH_REQUIRED = 411;
    public static final int HTTP_PRECON_FAILED = 412;
    public static final int HTTP_ENTITY_TOO_LARGE = 413;
    public static final int HTTP_REQ_TOO_LONG = 414;
    public static final int HTTP_UNSUPPORTED_TYPE = 415;
    /** 5XX: server error */
    public static final int HTTP_SERVER_ERROR = 500;
    public static final int HTTP_INTERNAL_ERROR = 501;
    public static final int HTTP_BAD_GATEWAY = 502;
    public static final int HTTP_UNAVAILABLE = 503;
    public static final int HTTP_GATEWAY_TIMEOUT = 504;
    public static final int HTTP_VERSION = 505;
    /* the Web server's virtual root directory */
    public static File root;
    static PrintStream log = null;
    /* Configuration information of the Web server is present
    * in this props object
    protected static Properties props = new Properties();
    /* timeout on client connections */
    static int timeout = 0;
    /* maximum number of worker threads */
    static int workerThreads = 5;
    /* General method for printing strings */
    static void printString(String s) {
    System.out.println(s);
    /* print logs to the log file */
    static void log(String s) {
    synchronized (log) {
    log.println(s);
    log.flush();
    /* print to the log file */
    static void printProperties() { 
    printString("\n");
    printString("#####################################################################");
    printString("\n");
    printString("Web server's virtual root directory= "+root);
    printString("Timeout on client connections in milliseconds= "+timeout);
    printString("Number of Worker Threads= "+workerThreads);
    printString("\n");
    printString("#####################################################################");
    printString("\n\n");
    printString("********************WEBSERVER STARTED SUCCESSFULLY********************\n");
    /* load server.properties from java.home */
    static void loadServerConfigurationProperties() throws IOException {
    File f = new File(System.getProperty("java.home")+"\\lib\\"+"server.properties");
    if (f.exists()) {
    InputStream is =new BufferedInputStream(new FileInputStream(f));
    props.load(is);
    is.close();
    String r = props.getProperty("root");
    if (r != null) {
    root = new File(r);
    if (!root.exists()) {
    throw new Error(root + " Server Root Directory does not exist");
    r = props.getProperty("timeout");
    if (r != null) {
    timeout = Integer.parseInt(r);
    r = props.getProperty("workerThreads");
    if (r != null) {
    workerThreads = Integer.parseInt(r);
    r = props.getProperty("log");
    if (r != null) {
    log = new PrintStream(new BufferedOutputStream(
    new FileOutputStream(r)));
    /* Assign default values to root, timeout,
    * workerThreads and log if the same have
    * not been specified in the server.propwerties file
    if (root == null) {   
    root = new File(System.getProperty("user.dir"));
    if (timeout <= 1000) {
    timeout = 5000;
    if (workerThreads > 25) {
    printString("\n");
    printString("#####################################################################");
    printString("\n");
    printString("Too many Threads!!!Maximum number of Worker Threads can be 15 only");
    printString("\n");
    printString("#####################################################################");
    workerThreads = 15;
    if (log == null) {
    log = System.out;
    public class WebServer extends Constants {
    /* Specifying Default port for listening the requests */
    static int port = 8080;
    /* The Vector class implements a growable array of objects.
    * Like an array, it contains components that can be accessed using an integer index.
    * The size of a Vector can grow or shrink as needed to accommodate adding and
    * removing items after the Vector has been created.
    * The workerThreads are added to the Vector object threads where the worker threads stand idle
    * Vector is used since it is synchronized
    static Vector threads = new Vector();
    public static void main(String[] userSpecifiedPort) throws Exception {
    if (userSpecifiedPort.length > 0) {
    port = Integer.parseInt(userSpecifiedPort[0]);
    loadServerConfigurationProperties();
    printProperties();
    /* Instantiate ThreadPoool class and call
    * the createThreadPool() method on threadPool object
    ThreadPool threadPool= new ThreadPool();
    threadPool.createThreadPool();
    /* This class implements java.lang.Runnable.
    * It runs in a worker thread to process the request and serve files to the clients.
    class Worker extends WebServer implements Runnable {
    static final byte[] EOL = {(byte)'\r', (byte)'\n' };
    final static int BUFFER_SIZE = 2048;
    /* A byte array buffer to read and write files.
    * Memory is allocated to it once in the construtor of the class Worker
    * and reused thereafter
    byte[] buffer;
    /* Socket for the client being handled */
    private Socket socket;
    Worker() {
    buffer = new byte[BUFFER_SIZE];
    socket = null;
    synchronized void setSocket(Socket socket) {
    this.socket = socket;
    notify();
    public synchronized void run() {
    do {
    if (socket == null) {
    /* Wait */
    try {
    wait();
    } catch (InterruptedException e) {
    continue;
    try {
    handleClientRequest();
    } catch (Exception e) {
    e.printStackTrace();
    socket = null;
    Vector pool = WebServer.threads;
    synchronized (pool) {
    /* When the request is complete add the worker thread back
    * into the pool
    pool.addElement(this);
    }while(true);
    void handleClientRequest() throws IOException {
    InputStream is = new BufferedInputStream(socket.getInputStream());
    PrintStream ps = new PrintStream(socket.getOutputStream());
    /* we will only block in read for this many milliseconds
    * before we fail with java.io.InterruptedIOException,
    * at which point we will abandon the connection.
    socket.setSoTimeout(WebServer.timeout);
    socket.setTcpNoDelay(true);
    /* Refresh the buffer from last time */
    for (int i = 0; i < BUFFER_SIZE; i++) {
    buffer[i] = 0;
    try {
    /* We will only support HTTP GET/HEAD */
    int readBuffer = 0, r = 0;
    boolean endOfLine=false;
    while (readBuffer < BUFFER_SIZE) {
    r = is.read(buffer, readBuffer, BUFFER_SIZE - readBuffer);
    if (r == -1) {
    /* EOF */
    return;
    int i = readBuffer;
    readBuffer += r;
    for (; i < readBuffer; i++) {
    if (buffer[i] == (byte)'\n' || buffer[i] == (byte)'\r') {
    /* read one line */
    endOfLine=true;
    break;
    if (endOfLine)
    break;
    /*Checking for a GET or a HEAD */
    boolean doingGet;
    /* beginning of file name */
    int index;
    if (buffer[0] == (byte)'G' &&
    buffer[1] == (byte)'E' &&
    buffer[2] == (byte)'T' &&
    buffer[3] == (byte)' ') {
    doingGet = true;
    index = 4;
    } else if (buffer[0] == (byte)'H' &&
    buffer[1] == (byte)'E' &&
    buffer[2] == (byte)'A' &&
    buffer[3] == (byte)'D' &&
    buffer[4] == (byte)' ') {
    doingGet = false;
    index = 5;
    } else {
    /* This method is not supported */
    ps.print("HTTP/1.0 " + HTTP_BAD_METHOD +
    " unsupported method type: ");
    ps.write(buffer, 0, 5);
    ps.write(EOL);
    ps.flush();
    socket.close();
    return;
    int i = 0;
    /* find the file name, from:
    * GET /ATG/DAS6.3.0/J2EE-AppClients/index.html HTTP/1.0
    * extract "/ATG/DAS6.3.0/J2EE-AppClients/index.html "
    for (i = index; i < readBuffer; i++) {
    if (buffer[i] == (byte)' ') {
    break;
    String filename = (new String(buffer, 0, index,
    i-index)).replace('/', File.separatorChar);
    if (filename.startsWith(File.separator)) {
    filename = filename.substring(1);
    File targ = new File(WebServer.root, filename);
    if (targ.isDirectory()) {
    File ind = new File(targ, "index.html");
    if (ind.exists()) {
    targ = ind;
    boolean fileFound = printHeaders(targ, ps);
    if (doingGet) {
    if (fileFound) {
    sendResponseFile(targ, ps);
    } else {
    fileNotFound(targ, ps);
    } finally {  
    // socket.close();
    System.out.println("Connection Close nahi kiya");
    boolean printHeaders(File targ, PrintStream ps) throws IOException {
    boolean ret = false;
    int responseStatusCode = 0;
    if (!targ.exists()) {
    responseStatusCode = HTTP_NOT_FOUND;
    ps.print("HTTP/1.0 " + HTTP_NOT_FOUND + " not found");
    ps.write(EOL);
    ret = false;
    } else {
    responseStatusCode = HTTP_OK;
    ps.print("HTTP/1.0 " + HTTP_OK+" OK");
    ps.write(EOL);
    ret = true;
    log("From " socket.getInetAddress().getHostAddress()": GET " +
    targ.getAbsolutePath()+"-->"+responseStatusCode);
    ps.print("Server: Simple java");
    ps.write(EOL);
    ps.print("Date: " + (new Date()));
    ps.write(EOL);
    if (ret) {
    if (!targ.isDirectory()) {
    ps.print("Content-length: "+targ.length());
    ps.write(EOL);
    ps.print("Last Modified: " + (new
    Date(targ.lastModified())));
    ps.write(EOL);
    String name = targ.getName();
    int ind = name.lastIndexOf('.');
    String ct = null;
    if (ind > 0) {
    ct = (String) map.get(name.substring(ind));
    if (ct == null) {
    ct = "unknown/unknown";
    ps.print("Content-type: " + ct);
    ps.write(EOL);
    } else {
    ps.print("Content-type: text/html");
    ps.write(EOL);
    return ret;
    void fileNotFound(File targ, PrintStream ps) throws IOException {
    ps.write(EOL);
    ps.write(EOL);
    ps.println("The requested file could not be found.\n");
    void sendResponseFile(File targ, PrintStream ps) throws IOException {
    InputStream is = null;
    ps.write(EOL);
    if (targ.isDirectory()) { ;
    listDirectory(targ, ps);
    return;
    } else {
    is = new FileInputStream(targ.getAbsolutePath());
    try {
    int n;
    while ((n = is.read(buffer)) > 0) {
    ps.write(buffer, 0, n);
    } finally {
    is.close();
    /* mapping file extensions to content-types */
    static java.util.Hashtable map = new java.util.Hashtable();
    void listDirectory(File dir, PrintStream ps) throws IOException {
    ps.println("<TITLE>Multithreaded Webserver</TITLE><P>");
    ps.println("<html><body align=center>");
    ps.println("<center><h3><font color=#9999CC>Simple File Based MultiThreaded WebServer</font></h3></center>");
    ps.println("<table border=1 align=center>");
    ps.println("<tr bgcolor=#9999CC><td width=100% height=100% align=center><h3>Directory Listing</h3></td>");
    ps.println("<td width=40% height=40% align=center><h3>Type</h3></td>");
    String[] list = dir.list();
    for (int i = 0; list != null && i < list.length; i++) {
    File f = new File(dir, list);
    if (f.isDirectory()) {
    ps.println("<tr><td>");
    ps.println("<font size=\""+"2"+"\"face=\""+"Verdana"+"\"> <A HREF=\""+list[i]+"/\">"+list[i]+"</A></font><a href=\""+list[i]+"/\"></a>\n<BR></td>");
    ps.println("<td align=center><a href=\""+list[i]+"/\"><img src=\""+"/images/folder.jpg"+"\"></img></a>");
    ps.println("</td");
    ps.println("</tr>");
    } else {
    ps.println("<tr><td>");
    ps.println("<font size=\""+"2"+"\" face=\""+"Verdana"+"\"></A> <A HREF=\""+list[i]+"\">"+list[i]+"</A></font><A HREF=\""+list[i]+"\"></A>\n<BR></td>");
    ps.println("<td align=center><a href=\""+list[i]+"/\"><img src=\""+"/images/file.gif"+"\"></img></a>");
    ps.println("</tr>");
    ps.println("</table>");
    ps.println("<P><HR><I><font color=blue>"+(new Date())+"</font></I>");
    ps.println("<I><font color=blue>Copyright to HCL Technology Ltd</font></I>");
    ps.println("<I><font color=blue>Author Vivek Kumar Sinha</font></I>");
    ps.println("</body></html>");
    The ThreadPool class contains a Vector of WorkerThread objects.
    These objects are the individual threads that make up the pool.
    The WorkerThread objects will start at the time of their construction.
    If there are more HTTP requests than there are WorkerThreads,
    the extra requests will backlog until WorkerThreads free up.
    class ThreadPool extends WebServer{
    void createThreadPool(){
    for (int i = 1; i <= workerThreads; ++i) {
    Worker w = new Worker();
    Thread t=new Thread(w, "Worker Thread No."+i);
    t.start();
    /* Uncomment to check the number of worker threads running */
    // printString("Worker Thread No."+i+" Started");
    threads.addElement(w);
    try{
    ServerSocket serversocket = new ServerSocket(port);
    do {
    Socket socket = serversocket.accept();
    Worker w = null;
    synchronized (threads) {
    if (threads.isEmpty()) {
    /* Do nothing */
    } else {
    w = (Worker) threads.elementAt(0);
    threads.removeElementAt(0);
    w.setSocket(socket);
    } while (true);
    } catch (IOException e) {
    e.printStackTrace();

    Thank you for Welcoming me!!! I am very new to this forum so din't have this idea.
    I am unable to add the keep alive behavior . I don't have problem with any part of the code. The problem is i don't know how to make that enhancement in the existing code.
    Regards

  • 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

  • Powershell to rename file based on output

    Good Afternoon
    I was wondering if someone could assist with the below
    1. We currently have a system in place whereby a document is scanned onto the system as an image and this is saved in a central location folder
    2. I then run tesseract within powershell on this location folder, which is a program that can extract the image to txt file and this converts the image to a txt file and saves in the same location with the same name
    3. What i would like to do is for powershell to then search the extracted txt file and look for a particular regexpression (which i have) and to then rename the original file from point 1 to the output
    Is the above possible at all
    This is what i have so far, what this seems to do is look in my ocr folder and run tesseract and the output txt files end up in the same folder
    $TargetFolder1 = “c:\ocr\test\file.txt”
    $regex = '[0-9]{5,6}[\.][0-9]{0,1}'
    $result = out-file ("c:\OCR\Match\""imtest" + ".txt")
    select-string -Path $Targetfolder1 -list -Pattern $regex | % { $_.Matches } | % { $_.Value } > $_result
    cd "C:\Program Files (x86)\Tesseract-OCR"
    Apologies of it seems confusing
    Barrie

    Hi
    Many thanks for the info so far, much appreciated
    I have read around on the Microsoft Powershell learning site but becoming slightly confused with some more piping
    I previously mentioned that the tesseract program converts the ocr scanned tif file into a text file - Is it possible instead to have this output to a variable of some sort and then for my reg expression carry out the search in the variable and
    then rename the tif file based on the result of the regexpression
    Previously i have ran tesseract on a tif file via powershell which in turn produces a text file of the document in the file location
    I think it would be best if i ran tesseract on the tif file, then for powershell to export the results somewhere and the reg expression query can be run and the final result will rename the original tif file with the output of the reg expression
    Hope this makes sense and many thanks for help so far
    Regards
    Barrie

  • Help renaming pdf files based on internal content

    I work for a company that has thousands of E-tickets coming in daily, weekly, monthly, etc..
    These tickets come in bafhakfbaifh.pdf and we have to manually rename them or print them all out and then sort through them and put them in order.
    What I would like to do is:
    1. Split any pdf's that have more than one page or "ticket" in my case. I know how to do this with automator easily, but I'd love to keep it all in one program.
    2. Search the file for Event Name (i.e. Madonna)
    3. Search the file for Date of event (August 12, 2012)
    4. Search the file for Section, Row, Seat (124 3 12)
    5. Rename the file based on content found (Madonna August 12 2012 124 3 12.pdf)
    6. Move from original download folder to organized folders based on artist/team.
    7. Automatically print in alphabetical or some sort of designated order.
    Any help is muchly appreciated. So far, I found a PC program called A-PDF rename, but it is not automated enough to be practical. Hazel is awesome at OCRing the pdf and moving from folder to folder, but does not do enough.
    Any help is muchly appreciated.
    Thank you.

    You're looking for a PDF Parser or PDF miner tool (PDFminer) as a starting framework, and you'll almost certainly be writing custom code around that as parsing a text file that's effectively free-form and originating from multiple different sources almost always (always?) involves writing customized processing code and an on-going series of tweaks as the suppliers of the PDF change their ticket formats.  (Even apparently-simple details such as the time and date formats, for instance, can vary by geography and language and by supplier, and can derail common processing.)
    In some cases that I can envision, it'd be entirely possible that the data you're after is actually located in an embedded image and not in text that can be parsed.
    The best approach is to get folks to send you JSON or XML or some other format intended for interchange, and avoid the whole mess that is parsing or mining a printer-oriented format.
    The other obvious option is to use something like Amazon's Mechanical Turk or some other explicitly outsourced help.  Depending on how often the formats change and how many of these PDF files you're dealing with and how varied the formats are, sometimes throwing staff at the problem can be the most cost-effective approach.

  • HT2470 How to sort files in finder

    Is there any way to sort files in my finder first by kind (folders, pdfs, jpegs, docxs, etc.) and then by name?  Right now I can only sort by one or the other.  If I sort by kind, the files are grouped according to kind, but the names are mixed up.  If I sort by name, all file types and folders are sorted according to name.  I like the column view because it helps me see the directory structure easily.  I hope that doesn't have any influence on what I'm trying to do.

    Choose View > Arrange By > Kind to group by Kind. Then choose Option-View > Sort By > Name to sort within the Arrange-By groups.
    See this MacWorld article for more info about Finder sorting and arranging.

Maybe you are looking for