How to get file name on the base of extension

hi
reply me
how to get the filename on the base of extension from the
current directory......
for example
i create file with the "igg" extension and save in the folder
where the exe file of director save....
i want when exe run then exe file read filename of the
define( "igg" ) extension with out path just name of the file with
igg extension
tel me how
regards
farhana khan

Here's a solution that requires no xtras:
on GetFilesWithExtension(aFolderPath, aExtension)
-- INPUT: <aFolderPath> should be a valid string
folder path
-- <aExtension> may be a string file extension,
without the
-- dot. For example: "txt" or "igg"
-- OUTPUT: Returns an error symbol or a linear list of file
names
-- in the given folder. If an extension is given, only
-- files with the given extension will be listed. If not,
-- all files and folders will be listed.
vFileList = []
if not stringP(aFolderPath) then
return #stringPathExpected
end if
vIgnoreExtension = not stringP(aExtension)
vDelimiter = the itemDelimiter
the itemDelimiter = "."
n = 0
repeat while TRUE
n = n + 1
vFileName = getNthFileNameInFolder(aFolderPath, n)
if vFileName = "" then
exit repeat
end if
if vIgnoreExtension then
vFileList.append(vFileName)
else if the last item of vFileName = aExtension then
vFileList.append(vFileName)
end if
end repeat
the itemDelimiter = vDelimiter
return vFileList
end GetFilesWithExtension
You can also use
Buddy API's baFileList,
which allows you to do wildcard searching.

Similar Messages

  • How to get file name of the form attachment?

    Hi,
    is there anybody who is able to help me with the following problem???
    I started my process from Workspace ES and as a first step I attached one locale file (IMG.JPG or IMG.TIF e.g.) as a form attachment. I used "Attachments" bookmark in the Workspace ES.
    I need to get file name of attached file in the process!!!
    I tried to use "getTaskAttachments" component to get file name of form attachment but without success. This component successfully obtained attached file an stored it in the variable (type list, subtype document) but didn't produce all file attribute informations such as basename or Content Type:
    Is there some possibility to obtain file name (including file extension) by using "standard" tools and components of ALC?
    Thanks for your suggestions.

    Hi LekomDev,
    I faced the same situation some time back and this is what I know.
    Based on the file type few of the attributes will or will not be populated. (This is what the official documentation says about Document attributes)
    The file name that you are looking for would mostly be in 'name' attribute of Document object. The 'wsfilename' attribute is the atrribute which gets used to show the file name into Attachments tab of the workspace.
    So, if you are just interested in knowing the filenames then 'name' attribute is the place that you are looking for.
    But if you are trying to solve an issue in which Attachments against a Task isn't showing the filenames properly then you would need to copy the 'name' attribute value into 'wsfilename' attribute and then the Attachmetns against a Task would have the correct names.
    Tip: Use the Record and Playback option of the workbench to inspect the Document variable and you would see all of the values for a Document variable at desired step in your orchestration.
    hope this helps,
    cheers,
    Parth Pandya
    Blog: http://livecyclekarma.wordpress.com

  • How to get File name in Proxy program

    Hi,
    According to my business scenario, one XML file name comes from Legacy system and stores in a predefined directory. Now XI has to pick up that XML file and needs to call BAPI's which in turn updates the Target system ( SAP Tables).
    Now my problem is , XML File name is a combination of three fileds those are DATE , OBJECTKEY AND WORKFLOWNAME.
    Ex : YYYYMMDD_1234565789_WORKFLOWNAME.XML
         DATE_OBJECTKEY_WORKFLOWNAME.XML
    In proxy i need to get the file name and split into three fields ( those are DATE , OBJECTKEY AND WORKFLOWNAME ) which needs to send as import parameters in BAPI's.
    So please let me know from anyone in this group how to get the file name in the proxy program.
    Thanks & Regards
    K. naveen Kumar

    Hi,
    have a look at my new weblog:
    /people/michal.krawczyk2/blog/2005/11/10/xi-the-same-filename-from-a-sender-to-a-receiver-file-adapter--sp14
    to see how you can access filename
    Regards,
    michal

  • Get File name of the inbound file during mapping

    Scenario: to read the file name of the inbound file (which has date required for the mapping) during runtime.
    The requirement is to read the date of the inbound file (passed to the XI pipline by the file adapter) and populate the same in the outbound mapping structure.
    Any idea about how to do this?
    (I went through few options of using java.util.map. not successful yet)

    Hi Anand,
    I posted the same question a time ago, without any help....
    Can I find out the full filename of input file in message mapping?
    Posted: Nov 23, 2004 1:00 PM
    I have in XI 2.0 the following scenario :
    In the inbound fileadapter I read my input file. The filename of the input file is part fixed, part variable (Like INDATA01.txt, INDATA03.txt, etc).
    So in my Adapterconfiguration, I specify the filename with a wildcard (INDATA*.txt).
    What I now want to do, is in my Message Mapping use the full filename , so I can do something different for every filenumber. Is there a way where I can get the full filename available in my message mapping (I did not find the filename in the XML in the message trace).

  • How to get File name in Java Callout

    Hi,
    We are receiving EDI files with random file names through SFTP listening channel. How can we get the file name in the java callout.
    ~Ismail M

    You can try to find it out under CalloutMessage.
    CalloutMessage.getParameters().getProperty("filename")
    Thanks,
    Kathar

  • How to get file name in faultpolices file for file based rejection handler

    Hi All,
    I am implementing the file rejection handler in fault polices.xml
    Now i want to catch exact file name and use this in faultpolices.xml under Filename tag and move the rejected file to custom directory.
    Can some please let me know is it possible to catch the exact filename and use the same name in rejection handle.
    Suppose If we don't handle the rejection handler then these files will move to the default path in SOA HOME. But the file name remains the same. So i think this can be changed in SOA, but i am afraid i how can i do it.
    Please suggest me.
    Regards,
    Tarak.

    Hi,
    have a look at my new weblog:
    /people/michal.krawczyk2/blog/2005/11/10/xi-the-same-filename-from-a-sender-to-a-receiver-file-adapter--sp14
    to see how you can access filename
    Regards,
    michal

  • File-2-Proxy: Get file name in the inbound proxy?

    Hi,
    I need to know the file name in the inbound proxy. After a search I found that's possible mapping the file name to the target structure as it's explained in that link: [http://www.sdn.sap.com/irj/scn/weblogs;jsessionid=(J2EE3417200)ID1731350750DB00274596951164745615End?blog=/pub/wlg/2664]
    But I need to know if there is another way to access the file name in the inbound proxy without modifying the mapping.
    Thanks.

    this is possible by a dynamic configuration (there is no other easy way)
    some references -
    http://www.sdn.sap.com/irj/scn/weblogs;jsessionid=(J2EE3417500)ID1159980350DB00296046510040545862End?blog=/pub/wlg/13704
    the idea is to get the file name in runtime using the dynamic conf code and poulating it to any field that will be part of the proxy message

  • How to get file name on picture?

    Hi there.
    Is there a way to get the file name on the picture when exporting or "save as" my pictures? I am going to run a web site where people can order pictures and it will be much easier if I can have LR "printing" the file name on the picture.
    Regards,
    Deon

    Deon,
    I would try having this done by the web gallery itself (not on but below the picture). LR web galleries offer that option while building them.
    If you cannot achieve this, the most common way of putting metadata onto a picture during LR export is by using the LR/Mogrify 2 PlugIn.
    Beat Gossweiler
    Switzerland

  • How to get file name for failed request in JSOM

    hello friends,
    i am uploading files to sharepoint 2013 document library. due to some problem when a file is not uploaded request is failed and failed callback handler is executed. at this time how i can know for which file has not been uploaded.
    as i am uploading multiple files so it is necessary to know for which file error occurs.
    please help 
    Thanks in advance.
    Mukesh

    Hi Z..
    it will be hard for any one to understand the code. how ever I have provided bellow.
    theme is I need to upload multiple files selecting one by one asynchronously when a file will begin to upload It will show status of file name with processing image. similarly for other files.
    ones file successfully uploaded processing image will get hidden. and delete will appear.
    when error occurs for a file then processing div need to be removed for which I need file name when request failed. in failed handler
    function uploadData()
    var input = $("#fldFile")[0];
    if (input) {
    $("#uploadedfile").append("<div class='file'><label>" + input.files[0].name + "</label><div class='image'><img src='/_layouts/15/KPMG.VendorPortal.DMS/processing.gif' alt='processing..'/><img src='/_layouts/15/KPMG.VendorPortal.DMS/error.png' alt='delete' style='display:none;' /></div>");
    file = input.files[0];
    filename = input.files[0].name;
    fr = new FileReader();
    fr.onload = uploaddocument;
    fr.readAsDataURL(file);
    function uploaddocument()
    web = clientContext.get_web();
    clientContext.load(web);
    list = web.get_lists().getByTitle("TempLibrary");
    rootFolderUrl = list.get_rootFolder();
    file = this.result;
    clientContext.load(rootFolderUrl);
    clientContext.executeQueryAsync(onuploaddocumentsuccess, failed);
    function onuploaddocumentsuccess()
    fileCreateInfo = new SP.FileCreationInformation();
    fileCreateInfo.set_url(rootFolderUrl.get_serverRelativeUrl() + "/" + foldername + "/" + filename);
    fileCreateInfo.set_overwrite(true);
    fileCreateInfo.set_content(new SP.Base64EncodedByteArray());
    // Read the binary contents of the base 64 data URL into a Uint8Array
    // Append the contents of this array to the SP.FileCreationInformation
    var arr = convertDataURIToBinary(file);
    for (var i = 0; i < arr.length; ++i) {
    fileCreateInfo.get_content().append(arr[i]);
    // Upload the file to the root folder of the document library
    uploadedfile= list.get_rootFolder().get_files().add(fileCreateInfo);
    clientContext.load(uploadedfile);
    clientContext.executeQueryAsync(documentuploaded, documentfailed);
    function documentuploaded()
    var fname = uploadedfile.get_name();
    $("#uploadedfile").children("div").each(function () {
    var flabelname = $(this).children("label").text();
    if (flabelname.trim() == fname.trim())
    $(this).children("div").children("img").get(0).style.display="none";
    $(this).children("div").children("img").get(1).style.display="block";
    alert("uploaded");
    function documentfailed(sender,args)
    Mukesh

  • How to get file name in adapter module

    Hi all
    Is it possible to get the file name in a adapte module? If so how can I achieve this?

    Hi,
    Check below thread. it shows code for file name.
    [Re: Query regarding Adapter Module development]
    -Gouri

  • How to get file name using File adapter Sync read

    Hi All,
    I am using SOA 10.1.3.3 and JDEV 10.1.3.3.
    I have an async bpel process.
    I have to read file name in this process... so i have used file adapter sync read operation.
    How can we get the file name with out payload using sync read.
    For normal read (Inbound Spec)we have UseHeaders="true" property.
    Is there any property for sync read to read the file name.
    Please help me
    Regards
    PavanKumar.M
    Edited by: [email protected] on Oct 27, 2009 11:23 PM

    Hi Eric,
    The info in the link provided by you is for a normal read.
    I need to read he file name using Sync read operation.
    Regards
    PavanKumar.M

  • How to get file name and set it as static text in a dialog

    Hi,
    I m new to InDesign Programming.
    I have a menu that creates a dialog with different controls in it.
    The dialog will appear only if there is an open file. I need to display the name of the open file as a static text in the dialog. I know to get the name of the current file but don't know how to pass this each time the dialog is opened.
    Can someone help me in doing this?
    I m using InDesign CS3 in MAC OS.
    Thank You.

    those are the methods, but you can't use getCharacterEncoding(), actually, cuz it seems it's not necessarily filled in.. or at least that might be on some servers only, like Tomcat 4. As for encodings, you need to do a search for character encoding names and use the appropriate one.

  • How to specify file names for the generated code in wscompile

    Hi,
    We want to follow a certain file naming conventions for the artifacts generated by wscompile.
    How is it possible to set the name for the service interface file, service implementation file etc....
    This is possible in AXIS ant task Wsdl2Java. How do we do it for wscompile.
    thanx

    Thanks Chris and c. Under Description I'm presented with three Names for the profile: ASCII, UniCode and Mac Script. ASCII and Mac Script are the same name for the profile, with nothing being in the UniCode Name box. Which do I change -- both?
    Am I going to screw things up in Photoshop if I change these names to something I can comprehend? Looks like I may just have to make a sticky-note list of the cryptic profile names with my own descriptive name as a reference. Thanks.

  • How to get file names of processes

    i am writing an application engine for monitoring ps jobs and processes i want to send an email to support group with log file if any process runs to error. Can anybody tell me how to get the log/trace files generated for each process. i tried many ways but did not get any clue would greatly appreciate for giving me information.
    thanks
    shiv

    Yes man it is possible, follow these steps if you want to automate process monitoring:
    1. Create a view for retrieving all the processes which are errored in a specific time for example 180 minutes. You can use all the following record for various information about a process or job
    PSPRCSRQST,PSOPRDEFN, PS_PRCSDEFN, PSPRCSPRFL, XLATTABLE_VW
    2. Create a table to store the process instance which was last monitored
    3. In application engine access the view which you have created in step 1, this view will give you all the processes which got errored out.
    4. In application engine use SendMail function to send an email with the process instance details which are errored out.
    5. After reading last row from the view update the table which you created in step 2 with the process instance you have read in last.
    This design should be able to send an email to support group if the process is errored out.
    Jayaprakash Tedla
    Sr. Architect - PeopleSoft

  • File to idoc how to get file name at runtime

    Hi Experts,
    In my file to idoc scenario,
    the requiremnt is like in mapping i have to give condition like if file name is name1 then one target filed is 40 and if file name is name2 then that target field is 60.
    how can we achieve this ?
    Regards,
    rohit

    Hi Rohit
    mughdha is right but you can do it through graphical mapping easily
    give condition in fix value under category conversion like this
    1) source-> FIX VALUE ->if value is true then map FIX value
    else nothing
    double click on first FIX VALUE function and assign your input values for file (for ex 40 or 60,......) in the key field and in the value field assign TRUE
    if this condition will be true the it willl map second FIX VALUE
    else assign a constant with empty value
    in second fix value assign values (for ex 40 or 60,......) which you have checked in first FIX VALUE function in key field and assign corresponding name which you required in the value field
    hope this will solve your problem
    Thanks
    sandeep
    if helpful reward points

Maybe you are looking for

  • List of open work orders

    Hi all, How to detwermine whether an open work order exist for a particular material and the plant. Is there a transaction where i can check the open work orders given the above input parameter. Regards Hemanth

  • I need help with an email inbox issue

    so basically I forgot my answers to my security questions, so I pressed "reset anwers....." And they said "email sent" but I waited to hours, days and didn't get that email! But I got an email from Apple about other stuff like opening iCloud and stuf

  • Terms & Conditions problem in App Store

    I want to install a free app on my Iphone. But every time that I try, app store show me a message of "Terms & Conditions have changed.." that I should agree. I have agreed around 15 times and I still can't download the app. Can anybody help me?

  • PI 7.1 SP 6 : 307 Temporary Redirect

    Hello All, For one of our very simple scenarios UI - XI - Java Backend Service. The web service which we are consuming using our Receiver SOAP Adapter the backend service throws the following error message : 307 Temporary Redirect. Are there any sett

  • Displyaing image in JPanel

    I am using below code to display image in jpanel. It is not displaying image. Please help me. import java.util.Vector; import javax.swing.*; import javax.swing.border.*; import java.awt.*; import java.awt.event.*; import java.awt.Toolkit; import java