How to replace the end of a file name

I have a seriously dumb question...
I have a row of thousands of file names (top-down, row a), these names are, for example, "photo-1.jpg" and I need to change the .jpg to .nef. How can I accomplish this?
thanks!!

Or just use this 'Find Replace in Selection' Automator Service (Dropbox download) without having to fuss about taking columns out to another app, fiddling with them there, and bring them back in.
It is just a short AppleScript that, after a quick installation, will look like this in your menu:
Select the cells where you want to make the replacement, choose 'Find Replace in Selection' from the menu, and enter the find-replace values when prompted. In your case you will see something like this:
Hit OK and you're done.
One-time installation is just a doubleclick on the .workflow package.
Depending on your settings you may have to go to System Preferences > Security & Privacy and click 'Open Anyway'.
'Install' simply moves the script to your Library > Services folder so it will show up in your Numbers menu.  It doesn't do anything to the innards of your computer.  If you want, you can check out the script first by choosing 'Open with Automator'.
Since this (obviously) changes values in your document you might want to test it first to make sure it is working as you want.
If you need to get rid of it then in Finder hold down the option key, choose Go in the menu and navigate to Library > Services, where you can trash it the way you would any other file or package in Finder.
SG
Edit: use jpg and nef rather than .jpg and .nef.

Similar Messages

  • BUG: Extra characters at the end of attachment file names

    I received complaints that my attachments didn't open on the PC's of the recipients. After I saw the messages I noticed there were extra characters at the end of their file names. That's why they wouldn't open. When I looked into my sent mail folder it was there as well. The addition took place when I sent the mail, while composing everything looked fine. It took me a while to realize the pattern. There was one extra for every non-ASCII character in the file name.
    Apparently Mail.app is using two different libraries. The other one counts the non-ASCII characters as two while the other doesn't. I don't know whether Finder still uses MacRoman or Unicode, but this seems to relate to double-byte characters.
    The short term solution is to use only ASCII for file names, but that's not what OS X is all about.

    The class files are broken. Recompile them. If you're uploading them, doublecheck if the FTP program used doesn't do mad things with binary files.

  • How to replace the string in a file

    Hi, I have a file which contains the following data
    File.dat
    <file>
    <filenum>
    W10
    </filenum>
    <hello>Heading </hello>
    </file>
    I need to replace the contents of file.dat
    database sequence value (for example xx_seq.nextval)
    Can some one please tell me how to search this <filenum>
    W10</filenum>
    and replace this with xx_seq.nextval
    and write the entire contents of the file to new file
    I am doing some thing like this
    suppose if my database value returns 11 from the above sequence then
    the output should be in file2.dat as
    <file>
    <filenum>
    11</filenum>
    <hello>Heading </hello>
    </file>
    declare f_in utl_file.file_type;
    s_in varchar2(10000);
    string1 varchar2(32000);
    x number;
    begin
    f_in := utl_file.fopen('SAMPLEDIR','input.txt','R');
    f_in1 := utl_file.fopen('SAMPLEDIR','input1.txt','W');
    select xx_seq.nextval into x from dual;
    loop
    begin utl_file.get_line(f_in,s_in);
    EXCEPTION
    WHEN NO_DATA_FOUND THEN
    EXIT;
    string1:= string1 || s_in;
    utl_file.put_line( (f_in1,s_in);
    end;
    end loop;
    utl_file.fclose(f_in);
    end;
    In this case it is reading and writing as it is, but unable to replace the sequence value
    Can some one please tell me how to do using replace function
    Thanks

    Hi, I have tried this but getting error
    step 1: create table test_dept(dno number, dname varchar2(20))
    insert into test_dept values(10,'10-Sourcing dept');
    insert into test_dept values(20,'20-Audting dept');
    insert into test_dept values(30,'30-Computer dept');
    select * from test_dept;
    DNO DNaME
    10     10-Sourcing dept
    30     30-Computer dept
    20     20-Audting dept
    step 2:
    create table test_web (name varchar2(60), xml_col xmltype) ;
    step 3:
    create sequence test1_seq start with 100 increment by 1
    step 4:
    test.out has the following contents (it is not .xml file) and i dont have <?xml version="1.0" ?> tag at the begining
    <File>
    <File_Type>Type1</File_Type>
    <File_Header_Record>
    <file_num>WP10</file_num>
    </File_Header_Record>
    <Transaction>
    <Transaction_Type>TR 1</Transaction_Type>
    <Amount>
    <Amounts>100</Amounts>
    </Amount>
    <Depts>
    <Dept_Type>Sourcing</Dept_Type>
    <Dept>10</Dept>
    </Depts>
    </Transaction>
    <Transaction>
    <Transaction_Type>TR 2</Transaction_Type>
    <Amount>
    <Amounts>200</Amounts>
    </Amount>
    <Depts>
    <Dept_Type>Auditing</Dept_Type>
    <Dept>20</Dept>
    </Depts>
    </Transaction>
    <Transaction>
    <Transaction_Type>TR 3</Transaction_Type>
    <Amount>
    <Amounts>300</Amounts>
    </Amount>
    <Depts>
    <Dept_Type>Computer</Dept_Type>
    <Dept>30</Dept>
    </Depts>
    </Transaction>
    </File>
    step 5:
    DECLARE
    v_check_file_exist BOOLEAN;
    v_file_length NUMBER;
    v_block_size NUMBER;
    v_file_path VARCHAR2 (100);
    v_file_name VARCHAR2 (100);
    v_file_type UTL_FILE.FILE_TYPE;
    v_str varchar2 (32760);
    v_cnt number;
    v_seq number;
    --check whether file exists and has data in it
    BEGIN
    v_file_path := '/usr/tmp';
    v_file_name := 'test.xml.out';
    -- initailise the variables
    v_cnt := 0;
    UTL_FILE.FGETATTR (v_file_path,
    v_file_name,
    v_check_file_exist,
    v_file_length,
    v_block_size);
    if v_check_file_exist
    then
    DBMS_OUTPUT.put_line (' File exists');
    IF v_file_length > 0 AND v_block_size > 0
    THEN
    BEGIN
    select test1_seq.nextval into v_seq from dual;
    insert into test_web values(v_seq,v_file_name);
    EXCEPTION
    WHEN NO_DATA_FOUND
    THEN
    DBMS_OUTPUT.put_line ('No data found '||SQLERRM);
    WHEN OTHERS
    THEN
    DBMS_OUTPUT.put_line ('others '||SQLERRM);
    END;
    commit;
    ELSE
    DBMS_OUTPUT.put_line ('No Data in File');
    END IF;
    ELSE
    DBMS_OUTPUT.put_line (' File Not Available');
    END IF;
    END;
    I am getting below error
    File exists
    others ORA-31011: XML parsing failed
    ORA-19202: Error occurred in XML
    processing
    LPX-00210: expected '<' instead of 't'
    Error at line 1
    My requirement is to replace the
    1. contents of the file WP10 from <file_num>WP10</file_num>
    with sequence value 'WP101' because sequence is starting at 100
    2. Replace all Dept tag <Dept>30</Dept> with Dname value from test_dept table
    for example
    <Dept>10</Dept> should be replaced with <Dept>10-Sourcing dept</Dept>
    update the
    when i say select * from test_web;
    It should contain this row
    101 <File>
    <File_Type>Type1</File_Type>
    <File_Header_Record>
    <file_num>WP101</file_num>
    </File_Header_Record>
    <Transaction>
    <Transaction_Type>TR 1</Transaction_Type>
    <Amount>
    <Amounts>100</Amounts>
    </Amount>
    <Depts>
    <Dept_Type>Sourcing</Dept_Type>
    <Dept>10-Sourcing dept</Dept>
    </Depts>
    </Transaction>
    <Transaction>
    <Transaction_Type>TR 2</Transaction_Type>
    <Amount>
    <Amounts>200</Amounts>
    </Amount>
    <Depts>
    <Dept_Type>Auditing</Dept_Type>
    <Dept>20-Audting dept</Dept>
    </Depts>
    </Transaction>
    <Transaction>
    <Transaction_Type>TR 3</Transaction_Type>
    <Amount>
    <Amounts>300</Amounts>
    </Amount>
    <Depts>
    <Dept_Type>Computer</Dept_Type>
    <Dept>30-Computer dept</Dept>
    </Depts>
    </Transaction>
    </File>
    Can you please check
    Thanks

  • Sender File adapter - DataTime stamp at the end of aarchived file name

    Hello,
    I am archiving the file once PI file sender adapter picks the file from source directory.
    The file is archived in the archive directory as <Date-Time-SSS_>FileName.
    I need to append the value <Date-Time-SSS_> after the file name.
    So archived file looks like FileName_<Date-Time-SSS>
    How can I achieve this? Appreciate your help for valuable suggestions.
    Thanks,
    Namadev

    Hi Namdev,
    Generally when we archive file then in sender CC we just put the processing mode as Archive and specify the Archived directory name in Archive Directory section. in that case when the Communication channel pick the source file then after picking it it remove it from source directory and put it into Archived directory without making any change in the file name.
    so if the file name is A.txt then in Archived directory also its name will be A.txt . However if you want to make any change in the name of the source file in the archived directory then you have two write Unix or DOC scrpt( depending upon your soure server )
    if your source server is Unix then write shell script otherwise dos scriprt
    .after wrtting the shell script just place in the archived directory or your source directory and call it in by mentioning it in Coomand Line section of your sender CC. You can easily search and get the required  shell script .
    Regards,
    Saurabh

  • How to replace first letters of a file name using Power shell or CMD

    Hi guys i am having a problem on mane files that i have which are duplicated. The main reason i cant group them by name is because they have numbers in front of their name which differs Eg
    01 - fileName.txt
    09 - fileName.txt
    02 - fileName.txt
    11 - fileName.txt
    i have a shed loads of them and would like to rename them by deleting the first three characters if they are numbers. I managed to create a powershell script to do that but the problem was that it would not work properly because the file would have a duplicated
    name after deleting the first few chars.
    can anyone help with a better script which would add a number to the end of the file name eg:
    fileName1.txt
    fileName2.txt
    fileName3.txt
    Ps all the files start with two numbers followed by a dash, however i have manually done a few which does not start with numbers and should be left alone by the script
    Thank you

    Here's a quick way to do it. I'm not sure what your existing code looks like but it sounds like you could incorporate this line into it.
    if ($oldfilename -match "[0-9]")
    $newfilename = $oldfilename.split("-")[1].trim().split(".")[0] + $oldfilename.split("-")[0].trim() + "." + $oldfilename.split("-")[1].trim().split(".")[1]
    else
    $newfilename = $oldfilename
    01 - fileName.txt becomes fileName01.txt
    fileName.txt stays fileName.txt

  • How to detect the end of a loaded swf file

    Hello Guys
    This is my first time on this forum, come here with a great
    hope
    I have loaded a picture file (jpeg) and a video file (swf)
    into the main flash file using xml
    on frame 3, I load the picture and on frame 7, I load the
    video, there is a stop action on frame 6
    Now when the flash is executed the picture is displayed ( it
    says "Click here to view the video")
    when the user click the picture , the video is loaded and
    starts to play ---- so far everything is working fine
    now what I want to do is, once the video finishes playing (
    not stoped) I want to display the picture again
    can you tell me how to detect the end of an external loaded
    swf files,
    Please help me
    Thanking You
    Shriram

  • How to write to the end of a file

    i am tryign to write to the end of a file using bufferwriter and bufferreadear. I am trying to the read the file until i reach the end and then write in the end. I have some code but i dont know how to read until the end of the file.
    File file = new  File ("Product.txt");
              FileReader reader = new FileReader (file);
              BufferedReader readBuff = new BufferedReader (reader);
              FileWriter write = new FileWriter(file);
              BufferedWriter writeBuff = new BufferedWriter(write);
              String line = readBuff.readLine();     
    // i know i need to put a while loop somewhere around here

    I want to write to the end of the file, what do you mean when you say "then write() until you've written that many bytes, which will overwrite the bytes already in the file."
              File file = new  File ("Products.txt");
              FileReader reader = new FileReader (file);
              BufferedReader readBuff = new BufferedReader (reader);
              FileWriter write = new FileWriter(file);
              BufferedWriter writeBuff = new BufferedWriter(write);
              String line = readBuff.readLine();
              long fileSize = file.length();
              readBuff.close();
              writeBuff.close();
              } catch (IOException e){
                   System.out.println ("Error -- " + e.toString());
         }

  • How to load the data from excel file into temprory table in Forms 11g?

    Hi
    How to Load the data from excel file(Extension is .CSV) into the temporary table of oracle in Forms11g.
    My Forms Version is - Forms [64 Bit] Version 11.1.2.0.0 (Production)
    Kindly Suggest the Solution.
    Regards,
    Sachin

    Declare
        v_full_filename         varchar2(500);
        v_server_path           varchar2(2000);
        v_separator             VARCHAR2(1);
        v_filename              VARCHAR2(400);
        filename                VARCHAR2 (100);
        v_stop_load             varchar2 (2000);
        v_rec_error_log         varchar2(4000);
        v_error_log             varchar2(4000);
        ctr                     NUMBER (12);
        cols                    NUMBER (2);
        btn                     number;
        RES                     BOOLEAN;   
        application             ole2.obj_type;
        workbooks               ole2.obj_type;
        workbook                ole2.obj_type;
        worksheets              ole2.obj_type;
        worksheet               ole2.obj_type;
        cell                    ole2.obj_type;
        cellType                ole2.OBJ_TYPE;
        args                    ole2.obj_type;
        PROCEDURE olearg
        IS
        args   ole2.obj_type;
        BEGIN
        args := ole2.create_arglist;
        ole2.add_arg (args, ctr);                                
        ole2.add_arg (args, cols);                                   
        cell := ole2.get_obj_property (worksheet, 'Cells', args);
        ole2.destroy_arglist (args);
        END;
    BEGIN
    v_full_filename := client_get_file_name(directory_name => null
                                     ,file_name      => null
                                     ,file_filter    => 'Excel  files (*.xls)|*.xls|'  
                                                                            ||'Excel  files (*.xlsx)|*.xlsx|'                                                                 
                                     ,message        => 'Choose Excel file'
                                     ,dialog_type    => null
                                     ,select_file    => null
    If v_full_filename is not null Then
    v_separator := WEBUTIL_CLIENTINFO.Get_file_Separator ;
    v_filename := v_separator||v_full_filename ;
    :LOAD_FILE_NAME := substr(v_filename,instr(v_filename,v_separator,-1) + 1);                                
    RES := Webutil_File_Transfer.Client_To_AS(v_full_filename,"server_path"||substr(v_filename,instr(v_filename,v_separator,-1) + 1));     
    --Begin load data from EXCEL
    BEGIN
        filename := v_server_path||substr(v_filename,instr(v_filename,v_separator,-1) + 1); -- to pick the file
        application := ole2.create_obj ('Excel.Application');
        ole2.set_property (application, 'Visible', 'false');
        workbooks := ole2.get_obj_property (application, 'Workbooks');
        args := ole2.create_arglist;
        ole2.add_arg (args, filename); -- file path and name
        workbook := ole2.get_obj_property(workbooks,'Open',args);
        ole2.destroy_arglist (args);
        args := ole2.create_arglist;
        ole2.add_arg (args, 'Sheet1');
        worksheet := ole2.get_obj_property (workbook, 'Worksheets', args);
        ole2.destroy_arglist (args);
        ctr := 2;                                                     --row number
        cols := 1;                                                -- column number
        go_block('xxx');
        FIRST_RECORD;  
        LOOP       
                --Column 1 VALUE --------------------------------------------------------------------
            olearg;
            v_stop_load := ole2.get_char_property (cell, 'Text'); --cell value of the argument
            :item1 := v_stop_load;
            cols := cols + 1;                                                      
              --Column 2 VALUE --------------------------------------------------------------------
            olearg;
            :item2 := ole2.get_char_property (cell, 'Text'); --cell value of the argument
            cols := cols + 1;
            --<and so on>
        ole2.invoke (application, 'Quit');
        ole2.RELEASE_OBJ (cell);
        ole2.RELEASE_OBJ (worksheet);
        ole2.RELEASE_OBJ (worksheets);
        ole2.RELEASE_OBJ (workbook);
        ole2.RELEASE_OBJ (workbooks);
        ole2.RELEASE_OBJ (application);
    END;
    --End load data from EXCELPlease mark it as answered if you helped.

  • How to read the complete path in file upload UI

    Hi,
    I want to know how to read the complete path in file upload UI in java web dynpro.
    I have created 1 file upload UI and than when i do browse and select some file say small.jpg from my local PC, desktop , its path is coming in file upload UI like E:\small.jpg,
    I want to know how to get this path in java webdynpro code.
    please let me know..

    Hi Satyam,
    In webdynpro java, first file stores in server location then it reads from server.
    Create a button with upload and write this code OnAction
    Resource is the attribute name in context of type com.sap.ide.webdynpro.uielementdefinitions.Resource, this attribute is for Resource property for Upload UI Element.
    Then in OnAction of button
    InputStream text = null;
           int temp=0;
           try{
                File file = new File(wdContext.currentContextElement().getResource().getResourceName().toString());
               String path = file.getAbsolutePath();
                wdComponentAPI.getMessageManager().reportSuccess(path);
           }catch(Exception e){
                e.printStackTrace();
        //@@end
    Regards,
    Pradeep
    Edited by: pradeep_546 on May 11, 2011 12:22 PM

  • Replacing the Header in rule file without changing source file(header defi)

    hi,
    i am loading the data using header in the Source file (.xls).
    I need to load the same file but for diff header (say instead of A1 i need A2) without any changes in source file.
    can someone please provide information that how to change the header in source file without opening/changing source file.
    Thanks in advance
    Anubhav Bisht

    HI SM,
    thanks for reply.
    the Problem is that there is two members in header defined in the source file that i need to change while loading the data.
    the load rule is picking header from the Source file, so replacing in the field is not working..
    do you have any other option/Suggestion.
    Regards
    Anubhav

  • How to read the data from Excel file and Store in XML file using java

    Hi All,
    I got a problem with Excel file.
    My problem is how to read the data from Excel file and Store in XML file using java excel api.
    For getting the data from Excel file what are all the steps i need to follow to get the correct result.
    Any body can send me the code (with java code ,Excel sheet) to this mail id : [email protected]
    Thanks & Regards,
    Sreenu,
    [email protected],
    india,

    If you want someone to do your work, please have the courtesy to provide payment.
    http://www.rentacoder.com

  • How to delete the specified line in file?

    How to delete the specified line in file? In case of deleting a specified line in a file, how to do?
    Line 1
    Line 2
    Line 3
    Line 4
    Line 5
    The case is a file including the above content. Now I wanna to delete the "Line 3" and how to realize the action in Java?

    An alternative solution can be :
    import java.io.LineNumberReader;
    import java.io.IOException;
    import java.io.File;
    import java.io.FileReader;
    import java.io.BufferedWriter;
    import java.io.FileWriter;
    import java.io.PrintWriter;
    public class LineDeleter {
    public static void main(String args[]){
    try {
    //suppose you want to delete line 3
         int lineToBeDeleted = 3;
         File f = new File("line.txt");
         long fileSize = f.length();
    //Wrap the FileReader with a LineNumberReader. It will help you
    //identify the lines.
    LineNumberReader lnr = new LineNumberReader( new FileReader(f));
    //Wrap the FileWriter object with BufferedWriter object. Create it with the buffersize
    //equal to the file size.
         BufferedWriter bw = new BufferedWriter(new FileWriter(new File("line1.txt")),(int)fileSize);
    //Wrap BufferedWriter object with PrintWriter so that it allows you
    //to print line by line
    PrintWriter pw = new PrintWriter(bw);
         String s=null;
         while ( (s=lnr.readLine())!=null ){
              System.out.println(s);
              int lineNumber = lnr.getLineNumber();
    //match the line number
              if(! (lineNumber==lineToBeDeleted)){
                   pw.println(s);
              pw.flush();
              lnr.close();
              pw.close();
         catch(Exception e){System.out.println(e);}
    If you want you can rename the line1.txt to the original file name.
    I hope this helps.Good luck!!!!!!

  • How to Load the data from excel file(Extension is .CSV) into the temp.table

    Hi
    How to Load the data from excel file(Extension is .CSV) into the temporary table of oracle in Forms11g.
    My Forms Version is - Forms [64 Bit] Version 11.1.2.0.0 (Production)
    Kindly Suggest the Solution.
    Regards,
    Sachin

    Hello Sachin,
    You can use the following metalink note:How to Read Data from an EXCEL Spreadsheet into a Form Using Webutil Client_OLE2 (Doc ID 813535.1) and modify it a little bit.
    Instead of copy values into forms you can save them in your temporary table.
    Kind regards,
    Alex
    If someone's helpful or correct please mark it accordingly.

  • How to load the data from .csv file to oracle table???

    Hi,
    I am using oracle 10g , plsql developer. Can anyone help me in how to load the data from .csv file to oracle table. The table is already created with the required columns. The .csv file is having about 10lakh records. Is it possible to load 10lakh records. can any one please tell me how to proceed.
    Thanks in advance

    981145 wrote:
    Can you tell more about sql * loader??? how to know that utility is available for me or not??? I am using oracle 10g database and plsql developer???SQL*Loader is part of the Oracle client. If you have a developer installation you should normally have it on your client.
    the command is
    sqlldrType it and see if you have it installed.
    Have a look also at the FAQ link posted by Marwin.
    There are plenty of examples also on the web.
    Regards.
    Al

  • How  to load the data from excel  file  into table in oracle using UTL_FI

    How to load the data from excel file into table in oracle
    and from table to excel file
    using UTL_FILE package
    Please give me some example

    This is something i tried in oracle apex
    http://avdeo.com/2008/05/21/uploading-excel-sheet-using-oracle-application-express-apex/
    Regards,
    CKLP

Maybe you are looking for

  • Java Applet HelloWorld "Getting Started With Applets" example not working

    Hi there, It's been ages since I ran my Linux CentOS boot of Linux but I am going through the official oracle java applet tutorials, just every time I try and run the "Hello World" applet in Firefox 17.0.3 and I am running the Iced Tea thing for java

  • Nokia 1020 Lumia Camera

    I have a problem whit, my lumia camera app, when i take many pictures in 5MP+38MP 4:3 mode the phone after some time freezes, and i have to do the restar, pressing the volume down and power button. And the phone creates corrupted 38MP pictures they t

  • Read Database before Archive : Program FI_DOCUMNT_WRI

    Hi                I use the program : FI_DOCUMNT_WRI to read the database before archeiving Data but there are some error message after exceute .I would like to know meaning or condition for this program the error message is "Withholding tax life (45

  • Server time out setting up email

    on my iphone I keep getting this message when trying to set up an email account. The connection to the server mail.xxxx.com on port 993 timed out

  • NewBie's Simple XML Question

    Hi Friends, I am starting to learn "xml"..got the complete reference book.But can someone please tell me how to start with it.i have a *.xml file and a *.xsl file.I am trying to call the xml file in my browser..but the xml file contents shows up..wit