Applescript: filenames from folder to append to csv

For my bookkeeping I need to scan and store my receipts as a PDF file, but transfer some information (like amount and category) to an Numbers (Excel)-sheet as well. I'm using TextExpender to include al information needed for the Numberssheet inside the filename, which looks something like this:
UIT4,20130401,23,categoryA,.pdf
I want to transfer all the pdf-filenames in the folder to append to a csv file, so I get:
test.csv
UIT4,201304001,23,categoryA
UIT5,201305002,25,categoryB
UIT2,201306001,22,categoryA
etc.
I can import the csv in Numbers and all is well.
My question for you is how can I use applescript to get all the pdf-filenames in a folder to append to a csv-file?
I've tried this modified script by Pierre L, but I get a error regarding the ending of the file??
set theFolder to choose folder
set theTextFile to POSIX file "/Users/user_name/Desktop/test.csv" -- for example
set theText to read theTextFile
tell application "Finder"
    set theFileNames to name of files of theFolder whose name extension is "pdf"
    repeat with thisName in theFileNames
        try
            set xx to (text 1 through 2 of thisName) as integer
            set theNewFileName to paragraph (xx + 1) of theText
            if character 3 of thisName is "-" then
                set theNewFileName to theNewFileName & character 4 of thisName
            end if
            set name of file thisName of theFolder to theNewFileName & ".pdf"
        end try
    end repeat
end tell
If you'd like to help out, that would be great!

Or perhaps you could write the replacement for "_" into ";" in the Applescript itself.
That's pretty easy using AppleScript - that way you could leave the file names intact and just change them before writing the data to the file. There are several ways of doing this and, unless you really want, I won't delve deep into the process of using text item delimiters, but an example script is below.
- the script lets me choose a folder in a dialog box, is it also possible to direct it to a pre-specified folder?
Of course. The first line is the one that triggers the Choose Folder dialog:
set theFolder to (choose folder)
You can just change this to any folder on disk by providing its path:
set theFolder to "Macintosh HD:Users:username:Desktop:My folder"
and making sure you tell the Finder that this represents a folder path:
          set theFiles to every file of folder theFolder whose name extension is "pdf"
(note the addition of the 'folder' keyword.
- is it possible to let the script create a new CSV-file named OUT4_[current date].csv?
Yes, but....
The third line in the script creates the output file.
          set csvFile to open for access (file ((path to desktop as text) & "my.csv")) with write permission
You can call it whatever you like - replace 'my.csv' with the desired file name. Just be careful in putting formatted dates into filenames since characters like the '/' in '11/24/2013' will be confusing since the / is used as a directory delimiter ('11/24/2013' would normally indicate the file called '2013' inside the '24' folder that is inside the '11' folder). Date formatting in AppleScript can be tricky, but its certainly do-able. How do you want it formatted?
Revised script that incorporates replacing underscores with commas:
set theFolder to "Macintosh HD:Users:you:Desktop:Some folder"
tell application "Finder"
          set csvFile to open for access (file ((path to desktop as text) & "my.csv")) with write permission
  set eof csvFile to 0 -- remove this line to append data
          set theFiles to every file of folder theFolder whose name extension is "pdf"
          repeat with eachFile in theFiles
                    set fn to name of eachFile
                    set csvData to my replaceChars(fn, "_", ",")
  write (csvData & return) as text to csvFile
          end repeat
  close access csvFile
end tell
on replaceChars(inputFileName, oldChar, newChar)
          set {tid, my text item delimiters} to {my text item delimiters, oldChar}
          set newfilename to text items of inputFileName
          set my text item delimiters to newChar
          set newfilename to newfilename as text
          set my text item delimiters to tid
          return newfilename
end replaceChars

Similar Messages

  • Acrobat 9 Batch Processing - Get PDF filenames from folder?

    Hello,
    Can anyone provide me with an example with how to use Batch Processing (when set to a specific folder/files) to get a list of filenames in that folder? I haven't been able to find any examples online. There doesn't seem to be any built in batch sequences that automatically do this so I assume it will need to be done with javascript?
    Ultimately, I need to automate a process (I was hoping to create a batch sequence to accomplish this) that will allow me to prompt a user to pick a source folder of PDFs and then based on that selection, run a Javascript that I create which will merge all PDFs in that folder into a new PDF, apply some crop setttings to each page, and then prompt the user where to save the merged PDF?
    Has anyone ever done anything like this? I would love to see an example of how this might be able to be achieved.
    Many thanks in advance.

    Have you tried to create a test batch process (now called Actions)?  Actions in Acrobat 10 has the "merge all files in folder" option, and batch processing in previous versions has always included a page crop commad as well as an option for asking the user where to save the file.
    There are lots of examples and articles on this topic at http://www.acrobatusers.com
    Thom Parker
    The source for PDF Scripting Info
    pdfscripting.com
    The Acrobat JavaScript Reference, Use it Early and Often
    Then most important JavaScript Development tool in Acrobat
    The Console Window (Video tutorial)
    The Console Window(article)

  • How to show filesystem(filenames from a folder) in SSRS

    Hallo everyone,
    I haved already tried the following solutions
    http://forums.asp.net/t/1422162.aspx?System+Security+SecurityException+Request+for+the+permission+of+type+System+Security+Permissions+FileIOPermission+mscorlib+Version+2+0+0+0+Culture+neutral+PublicKeyToken+b77a5c561934e089+failed+
    AND
    http://stackoverflow.com/questions/8476231/ssrs-custom-code
    Both didn't work.
    My problem is:
    What I want is to show all filenames from a certain folder in SSRS.
    I started with custom code in SSRS:
    Public Function getArrayOfFilename(pathname As String) as Array
    Dim arrayOfFilename As String() = System.IO.Directory.GetFiles(pathname)
    System.Array.Sort(Of String)(arrayOfFilename)
    Return arrayOfFilename
    End Function
    My questions are:
    1. If I try to call this function in a textbox like this:
    getArrayOfFilename("C:\Help\")
    then I get this error:
    [rsRuntimeErrorInExpression] The Value expression for the textrun ‘Textbox8.Paragraphs[0].TextRuns[0]’ contains an error: Request for the permission of type 'System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.
    2. Can I use this array as a dataset to carete a list or table  in SSRS?
    Thanks for any hint!

    The error message is related to permission. You are trying to access the file system object of the reporting server.
    Moreover creating a dataset from a custom code can be challenge, instead we can simply use TSQL to do this.
    ----------------- RUN TO ENABLE COMMAND SHELL
    EXEC sp_configure 'xp_cmdshell', 1;
    GO
    -- To update the currently configured value for this feature.
    RECONFIGURE;
    ----------------------QUERY
    DECLARE @folder VARCHAR(100) = 'C:\TESTING'
    DECLARE @DOSCommand varchar(1024); SET @DOSCommand =  'dir ' + @folder +'\'  + ' /A-D  /B'
    EXEC MASTER.dbo.xp_cmdshell @DOSCommand
    Regards, RSingh

  • How can we read filenames from a specific folder

    Hi forum,
    I have a situation that, there are several files coming daily in a specific folder.
    I want to read filenames from that folder and want to get that filename in a variable.
    That filename contains account nos. which I need for further processing.
    Now, how can we read filenames from a specific folder with using Oracle PL/SQL Procedure?
    Please suggest.
    Thanks & regards,
    Kiran

    If you are on 10g (not sure which exact release I'm afraid) you might look at Chris Poole's XUTL_FINDFILES that lists the files in a directory using PL/SQL and DBMS_BACKUP_RESTORE.SEARCHFILES (all a bit undocumented as it seems to be provided as part of rman).
    The conventional (i.e. supported) approach is to use a Java stored procedure - there is an example on AskTom.
    Message was edited by:
    William Robertson

  • Auto selection of file from folder during uploading??

    Hi all friends,
    Iam facing with one problem I am developing one uploading software for that i have used swing and servlet.Now my problem is i want to give auto selection of file from one folder means user just copy the files from any computer on network and paste it in predefind folder.And when they click on upload button it should start uploading of file one by one and after completion of uploading it move that file into another folder one by one.Now my software doing it perfectly but if user copy and paste any file in that predifined folder from network computer during uploading then they have to click upload button again after completion of first queue of files(for example if user first copy 10 files and start uploading and inbetween uploading of that 10 files if user copy another 10 files from network computer then they have to click on upload button again after completion of uploading of first 10 files).But my user requirement is they want to click on upload button once only at the time of starting my application and my application automatically select the file one by one from folder and send it to destination.Means if they copy the file from network machine inbetween uploading or any other user from network send file in that folder then my application should select those file automatically and start uploading means they don't want to click on upload button again.Can any one plz guide how I can slove this problem.Below r my codes:-
    Upload.addActionListener(new ActionListener() {
    public void actionPerformed(ActionEvent e) {
    try {
    suspendflag=true;
    Resume.setEnabled(false);
    Suspend.setEnabled(false);
    dest=frame.m_txtURL.getText();
    File ff=new File("d:\\DTMS\\Upload");
    File[] files = ff.listFiles();
    fileList = new Vector();
    if(files == null)
    textArea.append("There is no file");
    return;
    else
    for (int j = 0 ; j< files.length ; j++)
    fileList.add(files[j]);
    java.util.Collections.sort(fileList, new FileComp());//sorting by size
    new Thread(new Runnable() {
    public void run(){
    for (int k = 0; k < fileList.size(); k++)//loop for queue {
    File fname = (File)fileList.get(k);
    String str=fname.getName();
    log("Destination:" +" "+ dest);
    log("Uploading Progress\nPlease Wait....");
    result=doPost(fname,dest);//method for read file & send to servlet
    String str2="Transfer apparently failed.";
    String str3=result;
    if(str2.equals(str3)){
    Error(result);
    else if(suspendflag==true){
    File newfile =new File("d:\\DTMS\\Archives\\"+str);
    fname.renameTo(newfile);
    log("File" +" "+ str+" "+"Upload Completed !");
    else if(suspendflag==false){
    Error("** Transfer Suspended**");
    }).start();
    }catch(Exception exp)
    Error("Error : " + exp.toString());
    Regards
    Bikash

    Hi Chandan,
                        All the multiselection files are stored in it_tab( i:e file_table in method). you need to loop the every record to upload the data for selected files. please check the code Below...
    DATA: file_str1 type string.
    data: it_tab TYPE STANDARD TABLE OF file_table,
           wa_tab TYPE file_table,
           lw_file LIKE LINE OF it_tab,
           gd_subrc TYPE i.
    SELECTION-SCREEN begin of block blk with frame title text-100.
    SELECTION-SCREEN SKIP 2.
    parameters : p_file like rlgrap-filename .
    SELECTION-SCREEN end of block blk.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
    CALL METHOD cl_gui_frontend_services=>file_open_dialog
    EXPORTING
    window_title = 'Select only Text File'
    default_filename = '.azt'
    multiselection = 'X'
    CHANGING
    file_table = it_tab
    rc = gd_subrc.
    *READ TABLE it_tab INTO lw_file INDEX 1.
    *p_file = lw_file-FILENAME.
    Start-of-Selection.
    loop at it_tab INTO wa_tab.
       file_str1 = wa_tab-FILENAME.
    CALL FUNCTION 'GUI_UPLOAD'
       EXPORTING
         filename                      = file_str1
    *    filename                      = '\\10.10.1.92\Volume_1\_projekte\Zeiterfassung-SAP\test.azt'
       tables
         data_tab                      = it_string
    IF sy-subrc <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    ENDLOOP.

  • Building a report from folder items

    I would like to know whether somebody might be able to answer this question.
    I have a list of file type items held in a folder. These items happen to be statistical information and are held in the database as you can imagine as blobs. I want to be able to build a report that extracts the content of these items and combines them into a single report. No formatting is reuired simply as it appears. Any ideas, thoughts or suggestions?
    Thanks.

    All item data are stored in portal30.wwv_things table.
    Get the filename from this table for all the items you want.
    Then with the folder path, append this filename and
    open it with a URLconnection class in java(I am not sure with pl/sql) and use methods in URLconnection class to read the data.
    If you put this in the loop, you can join all the content of
    document files.
    Try this out.

  • Delete file from folder only (not from list)

    Hi all,
    I've searched a lot and didn't succeed so far, that's why I need your help. In a cloud context, I'm actually creating and uploading files (pdf and/or xml files) "on the go" to sharepoint folders via the SOAP API and this is perfectly working. But
    in a cloud context, I also need to decomission services which is translated into deleting files into Sharepoint.
    That's where it became complicated, because according to the API we cannot delete files if they are not part of a list structure, which is not my case. Is that true ?
    The only info I have when trying to delete a file via the SOAP Api is : its name, its folder, and the endpoint where the folder is. So my question remains simple I guess : is this possible ? If so, how to (a link to the SOAP body would be usefull)
    Thanks a lot
    Regards
    Baptiste

    Hi,
    According to your post, my understanding is that you want to delete file from folder.
    In SharePoint 2010, It is recommended to use Client Object Model to achieve it, the following code snippet for your reference:
    string siteURL = "http://siteurl";
    ClientContext context = new ClientContext(siteURL);
    //specific user
    NetworkCredential credentials = new NetworkCredential("username", "password", "domain");
    context.Credentials = credentials;
    Web web = context.Web;
    context.Load(web);
    context.ExecuteQuery();
    string relativeUrl =web.ServerRelativeUrl +"/DocumentLibraryName/FolderName/FileName";
    File file = web.GetFileByServerRelativeUrl(relativeUrl);
    context.Load(file);
    file.DeleteObject();
    context.ExecuteQuery();
    If you still want to use SOAP API, we can use the UpdateListItems method under Lists web service to achieve it.
    http://www.dhirendrayadav.com/2010/06/delete-list-items-using-web-service.html
    http://social.msdn.microsoft.com/Forums/sharepoint/en-US/61466984-1844-48a1-8c1e-1c59a0f9876a/move-and-delete-files-remotely-using-sharepoint-web-services-?forum=sharepointdevelopmentlegacy
    Thanks,
    Dennis Guo
    TechNet Community Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
    [email protected]
    Dennis Guo
    TechNet Community Support

  • File Receiver - Dynamically create filename from data in payload

    Hi there.
    Can anyone tell me the approach I need to take to be able to use the data in one field to determine the filename in the file receiver adaptor.
    I have a requirement that requires that I save a file with the following mask:
    xxxx_xxx<b><date extracted from field in payload></b>.csv
    I would appreciate any help on this.
    Thanks in advance.
    Mick.

    Hi Mick,
    you just need to use adapter specific parameters
    and you will be able to set the name in your mapping
    (from your payload)
    /people/william.li/blog/2006/04/18/dynamic-configuration-of-some-communication-channel-parameters-using-message-mapping
    Regards,
    michal
    <a href="/people/michal.krawczyk2/blog/2005/06/28/xipi-faq-frequently-asked-questions"><b>XI / PI FAQ - Frequently Asked Questions</b></a>

  • How to get all images from folder in c#?

    I am trying to get all images from folder. But it is not executing from following:
     string path=@"C:\wamp\www\fileupload\user_data";
                string[] filePaths = Directory.GetFiles(path,".jpg");
                for (int i = 0; i < filePaths.Length; i++)
                    dataGridImage.Controls.Add(filePaths[i]);
    Please give me the correct solution.

    How to display all images from folder in picturebox in c#?
    private void Form1_Load(object sender, EventArgs e)
    string[] files = Directory.GetFiles(Form1.programdir + "\\card_images", "*", SearchOption.TopDirectoryOnly);
    foreach (var filename in files)
    Bitmap bmp = null;
    try
    bmp = new Bitmap(filename);
    catch (Exception e)
    // remove this if you don't want to see the exception message
    MessageBox.Show(e.Message);
    continue;
    var card = new PictureBox();
    card.BackgroundImage = bmp;
    card.Padding = new Padding(0);
    card.BackgroundImageLayout = ImageLayout.Stretch;
    card.MouseDown += new MouseEventHandler(card_click);
    card.Size = new Size((int)(this.ClientSize.Width / 2) - 15, images.Height);
    images.Controls.Add(card);
    Free .NET Barcode Generator & Scanner supporting over 40 kinds of 1D & 2D symbologies.

  • Read contineously file from folder

    HI
    I have 1000 of files and I want read files from folder automatic. Each file ends with
    if $BATCH_FILE==true
    define $END,false
    else
    power off
    define $END,true
    if 1 text file is finish then it should load another file automatically

    Hi kalu,
    don't know what you're trying to do:
    - you have a "path" control but you don't use it for ListFolder...
    - you get an array of filenames from ListFolder, but you don't use that data later on...
    - you are using "OpenFile"/CloseFile to get a file path (in the event) and later on you use that path to read data from...
    Your original question doesn't has anything in common with those things you do now...
    Best regards,
    GerdW
    CLAD, using 2009SP1 + LV2011SP1 + LV2014SP1 on WinXP+Win7+cRIO
    Kudos are welcome

  • External Table which can handle appending multiple csv files dynamic

    I need an external table which can handle appending multiple csv files' values.
    But the problem I am having is : the number of csv files are not fixed.
    I can have between 2 to 6-7 files with the suffix as current_date. Lets say it will be like my_file1_aug_08_1.csv, my_file1_aug_08_2.csv, my_file1_aug_08_3.csv etc. and so on.
    I can do it by following as hardcoding if I know the number of files, but unfortunately the number is not fixed and need to something dynamically to inject with a wildcard search of file pattern.
    CREATE TABLE my_et_tbl
      my_field1 varchar2(4000),
      my_field2 varchar2(4000)
    ORGANIZATION EXTERNAL
      (  TYPE ORACLE_LOADER
         DEFAULT DIRECTORY my_et_dir
         ACCESS PARAMETERS
           ( RECORDS DELIMITED BY NEWLINE
            FIELDS TERMINATED BY ','
            MISSING FIELD VALUES ARE NULL  )
         LOCATION (UTL_DIR:'my_file2_5_aug_08.csv','my_file2_5_aug_08.csv')
    REJECT LIMIT UNLIMITED
    NOPARALLEL
    NOMONITORING;Please advice me with your ideas. thanks.
    Joshua..

    Well, you could do it dynamically by constructing location value:
    SQL> CREATE TABLE emp_load
      2      (
      3       employee_number      CHAR(5),
      4       employee_dob         CHAR(20),
      5       employee_last_name   CHAR(20),
      6       employee_first_name  CHAR(15),
      7       employee_middle_name CHAR(15),
      8       employee_hire_date   DATE
      9      )
    10    ORGANIZATION EXTERNAL
    11      (
    12       TYPE ORACLE_LOADER
    13       DEFAULT DIRECTORY tmp
    14       ACCESS PARAMETERS
    15         (
    16          RECORDS DELIMITED BY NEWLINE
    17          FIELDS (
    18                  employee_number      CHAR(2),
    19                  employee_dob         CHAR(20),
    20                  employee_last_name   CHAR(18),
    21                  employee_first_name  CHAR(11),
    22                  employee_middle_name CHAR(11),
    23                  employee_hire_date   CHAR(10) date_format DATE mask "mm/dd/yyyy"
    24                 )
    25         )
    26       LOCATION ('info*.dat')
    27      )
    28  /
    Table created.
    SQL> select * from emp_load;
    select * from emp_load
    ERROR at line 1:
    ORA-29913: error in executing ODCIEXTTABLEOPEN callout
    SQL> set serveroutput on
    SQL> declare
      2      v_exists      boolean;
      3      v_file_length number;
      4      v_blocksize   number;
      5      v_stmt        varchar2(1000) := 'alter table emp_load location(';
      6      i             number := 1;
      7  begin
      8      loop
      9        utl_file.fgetattr(
    10                          'TMP',
    11                          'info' || i || '.dat',
    12                          v_exists,
    13                          v_file_length,
    14                          v_blocksize
    15                         );
    16        exit when not v_exists;
    17        v_stmt := v_stmt || '''info' || i || '.dat'',';
    18        i := i + 1;
    19      end loop;
    20      v_stmt := rtrim(v_stmt,',') || ')';
    21      dbms_output.put_line(v_stmt);
    22      execute immediate v_stmt;
    23  end;
    24  /
    alter table emp_load location('info1.dat','info2.dat')
    PL/SQL procedure successfully completed.
    SQL> select * from emp_load;
    EMPLO EMPLOYEE_DOB         EMPLOYEE_LAST_NAME   EMPLOYEE_FIRST_ EMPLOYEE_MIDDLE
    EMPLOYEE_
    56    november, 15, 1980   baker                mary            alice     0
    01-SEP-04
    87    december, 20, 1970   roper                lisa            marie     0
    01-JAN-99
    SQL> SY.
    P.S. Keep in mind that changing location will affect all sessions referencing external table.

  • Filename from field

    I have seen in past discussions about the difficluty and even impossibility of creating a SAVE AS filename from a field value in an Adobe form.  These discussions were posted back in 2006-2008.
    I am hoping that someone knows a relatively simple way to do this (if it's possible in Acrobat 10)  I am relatively new to Adobe and Javascripts.
    All I want to do is have a button that does a SAVE AS (I can do this), but pull the filename from the "NAME" field in the form and add the .pdf extension and place it in a particular directory on the server.
    Seems like this would be possible...  can anyone point me in the right direction?
    Thanks a million!!
    DMD    

    George,
    I think I should document exactly what is happening, so here goes…
    FROM ACROBAT X PRO - The form is working and saving via the mouse up JavaScript action coupled with the folder-level JS that contains;
    myTrustedSpecialTaskFunc   and  mySaveAs = app.trustPropagatorFunction
    In order to save it for READER users, I do a FILE, SAVE AS, READER EXTENDED PDF, ENABLE ADDITIONAL FEATURES.
    I copy the folder level JS over to the proper JS folder associated with READER
    I can open the file in READER and edit the form fields. 
    When I try to save the file using the Custom Save As button that works in ACROBAT, I get this error;
    NotAllowedError: Security settings prevent access to this property or method.
    Doc.saveAs:4:Field Save:Mouse Up
    NOTES:
    ·         I know that I am using the correct JavaScript folder for READER because I placed this JS code in the folder and it DOES display when I open READER-  app.alert("It works!");
    ·         I am saving the file in both instances to c:\temp\filename.pdf
    ·         When I distribute the form, I will be able to place the folder-level JS on the users machine.
    Per your last post, when I open the file that I have saved as above for READER in ACROBAT and go to file>properties>security I have the following displayed;
    Security: No Security
    Can be opened by: All versions of Acrobat
    Document Restrictions Summary
    Printing: Allowed
    Changing the document: Not allowed*
    Document assembly: Not allowed*
    Content copying: Allowed
    Content copying for accessibility: Allowed
    Page extraction: Allowed
    Commenting: Allowed
    Filling of form Fields: Allowed
    Signing: Allowed
    Creation of template pages: Not allowed*
    *This document restricts some Acrobat features in order to allow for extended features in Adobe Reader
    At this point, I am a a loss as to what is causing the error.  I hope this documentation helps you see where my problem is.
    Thanks,
    Dan

  • Reading all files froma  folder

    Hi ,
    Does anyone know how to read the data from all text files in a given folder?
    I mean does text_io recongnises a certain sintax to do this?
    Thanks,
    Sandu

    Well
    I'm having problems initializing a java.lang.String as ora_java.jobject.
    I was able to import in forms my class ,(wich works ok when tested like standalone java class,it returns all the filenames from a folder),a package was generated on the form for it.
    But,I've got to pass it the folder name as a String.
    I've imported java.lang.String as ora_java.jobject,and a package was generated on the form.
    When I try to call string.new('c:\work');
    it won't compile,it says invalid reference to variable String.
    What should I do?Is there any predefined Type in ora_java package for java.lang.String?
    Thanks,
    Sandu

  • Hi,delete file from folder?

    hi,i am deleting file from folder as follwos
    <%@ page import="java.io.File" %>
    <%
    File myFile = new File("D:\\jakarta-tomcat-4.1.18\\webapps\\ROOT\\upload_files\\xyz.txt");
    myFile.delete();
    %>
    i am sucessfuly deleted file from above path.
    if i use follwing code i unable to delete my file, can one help,
    how to do it,
    <%@ page import="java.io.File" %>
    <%
    String fname="xyz.txt";
    File myFile = new File("D:\\jakarta-tomcat-4.1.18\\webapps\\ROOT\\upload_files\\'"+fname+"'");
    myFile.delete();
    %>
    thanks
    pullareddy

    i think if above doesn't work try this it should work
    change this line
    File myFile = new File("D:\\jakarta-tomcat-4.1.18\\webapps\\ROOT\\upload_files\\'"+fname+"'");
    to this
    File myFile = new File("D:\\jakarta-tomcat-4.1.18\\webapps\\ROOT\\upload_files\\"+fname);

  • Get filename from file sender adapter

    Hi Experts,
    I have a question regarding the file/ftp adapter (sender).
    I have a directory with xml and pdf files. for every xml file there is a pdf file with the same filename. for example:
    file1.xml
    file1.pdf
    file2.xml
    file2.pdf
    file3.xml
    file3.pdf
    Now I want to read the xml file with the file sender adapter. afterwards I want to read the related pdf file. for example: If I read the file file1.xml afterwards I want to read the pdf file file1.pdf with the file sender adapter. For this it is nessessary to get the filename from the xml file so that I can read afterwards the pdf file. How can I realise it?
    Thanks and best regards
    Christopher

    Hi srinivas,
    thanks for your quick answer.
    That the file adapter is not able to read pdf files is clear to me. In this case I only want to transport the pdf. that works fine. I tested it.
    the problem is the following:
    I have a xml file with the name "file1.xml". I read the xml file with the sender file/ftp adapter configured with filename "*.xml". Then I want to import the pdf file with the name "file1.pdf". Therefor I need the filename from the xml file.do you know what I mean? So XI has to know the filename of the xml to import the pdf with the same name ...
    regards

Maybe you are looking for

  • Pages 5.1

    I see that Apple have started to reinstate some missing features from previous versions of Pages. But these problems don't appear to have been solved. Has anyone got any ideas?? When changing view from 125% (which appears to be the one Pages likes) t

  • Enterprise Service Operation missing in VC 7.01

    Hi all, I have created a Enterprise service with two operations. When I test the enterprise service in the SOA Manager I see both operations in the webservice. When I use the same WSDL file in a systeem in VC I just get one operation. Can someone tel

  • Performence problem

    Hi All, I have written a select command on the table COEP based on objnr and vrgng fields ( both are required ) So when i was execuiting the query it was taking too much time for a single record. Can you guide me the alternative table or alternative

  • Spreadsheet not opening from the cloud

    I have a number of Numbers, spreadsheets saved on the cloud. 2-3 of them will no longer open.  I have tried duplicating and renaming but neither option helps.  Does anyone know of any further options I can pursue?

  • Can you sort bookmarks?

    Half my bookmark list is sorted alpha by the bookmark name, and half is not (the most recent additions).  Is there a way to sort all? Thanks