Grep for a particular entry in the file name

Dear all,
I have a folder with following list of files with names like
amg-9876544-M37421-3000282.PDF
amg-9876544-M37408-3000457.PDF
amg-9876544-M37488-3000260.PDF
amg-9876544-M37481-3300063.PDF
amg-9876544-M37454-3000675.PDF
amg-9876544-M37543-3000672.PDF
amg-9876544-M37541-3363000.PDF
amg-9876544-M37528-3000381.PDF
amg-9876544-M37524-3000432.PDF
amg-9876544-M37506-3000352.PDF
amg-9876544-M37500-3021100.PDF
amg-9876544-M37585-3850050.PDF
amg-9876544-M37577-3005105.PDF
amg-9876544-M37565-3000502.PDF
amg-9876544-M37611-3300527.PDF
amg-9876544-M37610-3300150.PDF
amg-9876544-M37607-3300259.PDF
I want to list all the files that has the entry with 33..for ex..file with name amg-9876544-M37607-3300259.PDF after the -.
If I give ls -rlt | grep *33* it lists all the file with entry 33 anywhere in it.I want to grep for files with 33 after that "-" in the file name..
Please suggest
Kai

If the only "-33" is the one you are interested in:
ls -rtl | grep -e -33The "-e" prevents grep(1), et. al., from thinking that "-33" is a command line
switch.
Cheers

Similar Messages

  • Code for reading particular  fields from the file placed in application

    hi,
    code for reading particular  fields from the file placed in application server in to the internal table.

    Hi,
    Use the GUI_UPLOAD FM to upload the File into ur Internal Table.
    DATA : FILE_TABLE TYPE FILE_TABLE OCCURS 0,
             fwa TYPE FILE_TABLE,
             FILENAME TYPE STRING,
             RC TYPE I.
    CALL METHOD CL_GUI_FRONTEND_SERVICES=>FILE_OPEN_DIALOG
      EXPORTING
        WINDOW_TITLE            = 'Open File'
       DEFAULT_EXTENSION       =
       DEFAULT_FILENAME        =
       FILE_FILTER             =
       INITIAL_DIRECTORY       =
       MULTISELECTION          =
       WITH_ENCODING           =
      CHANGING
        FILE_TABLE              = FILE_TABLE
        RC                      = RC
       USER_ACTION             =
       FILE_ENCODING           =
      EXCEPTIONS
        FILE_OPEN_DIALOG_FAILED = 1
        CNTL_ERROR              = 2
        ERROR_NO_GUI            = 3
        NOT_SUPPORTED_BY_GUI    = 4
        others                  = 5
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
                WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    READ TABLE FILE_TABLE INDEX 1 into fwa.
    FILENAME = fwa-FILENAME.
        CALL FUNCTION 'GUI_UPLOAD'
             EXPORTING
                  filename                = filename
                  FILETYPE                = 'DAT'
           IMPORTING
                FILELENGTH              =
             TABLES
                  data_tab                = itab
             EXCEPTIONS
                  file_open_error         = 1
                  file_read_error         = 2
                  no_batch                = 3
                  gui_refuse_filetransfer = 4
                  invalid_type            = 5
                  OTHERS                  = 6 .
        IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
             WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
        ENDIF.
    Regards,
    Balakumar.G
    Reward Points if helpful.

  • Export Indd to EPS/JPG and set the file name  for EPS/JPG file

    Hi,
       When I export the INDD to JPG/EPS, I want to set the file name with pageNumber  for JPG/EPS files using javascript.
    For Example
    If I set the file name as EPSFile.eps, after exporting the indd(with 2 pages) to eps
    ,files are generating in the following name EPSFile_1.eps, EPSFile_2.eps.
    but I want to set the file name as EPSFile_001.eps and EPSFile_002.eps using javascript.
    anyone knows please reply for this.
    Regards,
    Mubeen

    Hi,
      I tried the following code.
    var JPGe = new File("Applications/PDF/JPG/file.jp");
    app.activeDocument.exportFile(ExportFormat.jpg, );
    when I use this code ,exported jpg file names are
    file.jpg, file1.jpg,file3.jpg.
    but ,I want the output file names as file_001,file_002,file_003,
    Thanks,
    Mubeen

  • How to store the File Name from a Unix Directory into a ODI variable?

    Hi,
    I have built a ODI package with the following steps:
    1. ODI is polling for a flat file in a Unix directory. I have used OdiFileWait tool for this purpose. Here the file name is not fixed, so I am using wild character (*) to poll for file. Example: DF*ABC1*.DAT where the first wild character denotes 1 letter and the second wild character denotes 2 digits.
    2. In the second step, if the file is found, I am moving the file to ODI file server path (../oracledi/demo/file). Here I have used ODIFileMove tool.
    3. Then I am using an ODI Interface to Load the file data into a Oracle database table.
    4. I am using a Process log table to keep the log for each step I am executing in ODI that is ODIFileWait, ODIFileMove, Interface etc. for each file. In this table a row needs to be inserted after ODIFileWait tool gets the file, with the File Name and File Date. Later on this row will be updated as the consequent steps are executed.
    Here is my concern, I need to get the exact File Name of the file after ODIFileWait gets the file and I need to insert that in the Process Log table after the ODIFileWait step gets a file. So if I can store the File Name in a ODI Variable, I can insert it into the Process log table at this point. This I am not able to do.
    The files are coming in a different directory (not in ODI file server path), So after getting the file it is moved to ODI file server path (../oracledi/demo/file)
    The Files which I am processing are fixed length format. Also, the File name and File Date is stored in the 1st Record(Header record) of the files.
    Kindly provide me suggestions to implement this in my code.
    Thanks and Regards,
    Anik
    Edited by: 809820 on Nov 10, 2010 11:36 PM

    Look at this link -http://odiexperts.com/getting-one-or-several-unknown-files-from-a-directory
    change the command to fetch the ls command and write into File and then using either java or jython break the data and fetch the file name and date and insert into log table.
    (or)
    you can use the os.system command and get the complete ls command into string and then process and insert it.
    Let us know if you need any other help.

  • Create a derived column based on a value within the file name

    I am importing a CSV file which is easy enough, but I have an issue where I need to manufacture a couple of column values based on the filename of the input.  So this same process will import different types of records to the same table in sql server.
     I need to pull out the record code from the file name.  
    For instance, say I can use the same package to input two different CSV files.  One is named Input_M02_Data.csv and one named Input_B15_Data.csv.  I need to create a derrived column and store the record code there (i.e.:  M02 or B15) based
    on which file it came out of.  
    fyi-
    I also need to create a second column for Dept based off of the file name as well.  M02 is dept 45 and B15 is dept 99  which I also need to insert into this table when I import the data from the .csv file.  
    Any help is greatly appreciated!

    Hi Jason,
    According to your description, you want to add two derived columns based on the file name to also insert into table. One stores the value between two “_” within file name, another stores the department based on that column.
    If in this scenario, we can add a variable FileName that stores the filename, then add the two variables as derived columns like below in the Derived Column Transformation:
    Name:
    SUBSTRING(@[User::FileName],FINDSTRING(@[User::FileName],"_",1)+1,FINDSTRING(@[User::FileName],"_",2)-(FINDSTRING(@[User::FileName],"_",1)+1))
    Dept:
    @[User::Name] =="M02"?"dept 45":@[User::Name] =="B15"?"dept 99":"dept 00"
    The following screenshot is for your reference:
    If there are any other questions, please feel free to ask.
    Thanks,
    Katherine Xiong
    If you have any feedback on our support, please click
    here.
    Katherine Xiong
    TechNet Community Support

  • To Get the earlier records in a table for a particular id neglecting the newer ones

    Hi All,
    I need to get the older records for a particular id rejecting the newer ones..My Scenarios is as follows..
    ID      Result           Date
    1        Pass             2015-01-01
    1        Fail                2015-03-05
    2       Pass                2014-06-07
    2       Fail                  2015-02-02
    My Output will be 
    ID        Result              Date
    1          Pass                2015-01-01
    2          Pass                 2014-06-07
    How can i achieve this....Thanks in advance

    Please follow the basic Netiquette of all SQL forums for the past 35+ years on the Internet. Post DDL that follows ISO-11179 rules for data element names. You have no idea; you do not even know that DATE is a reserved word in SQL! Use industry standard
    encodings (ISBN, UPC, GTIN, etc) and avoid needless dialect. Give clear specifications. Give sample data. Web need to see the keys and constraints, the DRI, etc.  80-95% of the work in SQL is in the DDL. 
    If you do not know that rows are not records, fields are not columns and tables are not files, then you should not be posting. If your tables have no keys, you should not be posting. If you have not tried any DML yourself, you should not be posting. 
    >> I need to get the older records [sic] for a particular product_id, rejecting the newer ones..My Scenarios is as follows.. <<
    Now we have to do all your typing because of your bad manners. Thanks a lot. Here is a repair job. 
    CREATE TABLE Inspections 
    (product_id CHAR(5) NOT NULL,
     inspection_date DATE NOT NULL
    PRIMARY KEY (product_id, inspection_date),
     inspection_result CHAR(4) NOT NULL
     CHECK (inspection_result IN ('pass', 'fail'))
    INSERT INTO Inspections 
    VALUES
    ('prod1', '2015-01-01', 'pass'),
    ('prod1', '2015-03-05', 'fail'),
    ('prod2', '2014-06-07', 'pass')
    ('prod2', '2015-02-02', 'fail'); 
    Here is one way to do this: 
    WITH X(product_id, inspection_date, inspection_result, first_inspection_date)
    AS 
    (SELECT product_id, inspection_date, inspection_result,
            MIN(inspection_date) OVER (PARTITION BY product_id) 
       FROM Inspections)
    SELECT product_id, inspection_date, inspection_result
     FROM X 
    WHERE first_inspection_date = inspection_date;
    --CELKO-- Books in Celko Series for Morgan-Kaufmann Publishing: Analytics and OLAP in SQL / Data and Databases: Concepts in Practice Data / Measurements and Standards in SQL SQL for Smarties / SQL Programming Style / SQL Puzzles and Answers / Thinking
    in Sets / Trees and Hierarchies in SQL

  • Scan\Look for a particular character in a file

    I would like to look for a particular character(@) in a file. The character might be in a word. When if find the character I want to read the actual whole word that contains that character.
    What's the best way of going abt this?
    Thx,
    Kapapra.

    Read the file line by line using BufferedReader.
    Tokenize each line on space.
    Loop through the token strings.
    For each token that contains the character that you are looking for (e.g. @) found using indexOf operator of the String class, print or save (or whatever you want to do with that token) that token.
    Continue reading the file line by line till the end of the file.
    Does this make sense? Look the java.io package API for the details on how to read the file and stuff.
    If anyone has more effecient method to do this, please share.

  • Search for a particular character in a file

    I would like to look for a particular character(@) in a file. The character might be in a word. When if find the character I want to read the actual whole word that contains that character.
    What's the best way of going abt this?
    Thx,
    Kapapra.

    Use StringTokenizer, here is example
    StringTokenizer tokenizer = new java.util.StringTokenizer(yourString, " ");
    while(tokenizer.hasMoreTokens())
       String word = (String) tokenizer.nextToken();
       if ( word.indexOf("@") >=0 )
           // word contains @
      else
            // word does not contain @
    }

  • Why does the file Name for file attached with Annotations "Attach File" (paperclip) become Unknown when Comments are Published?

    Our company recently purchased Adobe Acrobat Pro XI for the purpose of using it for shared electronic reviews.  We are using Send for Shared Review created in Adobe Acrobat Pro XI, and all the Comment tools work as expectedexcept the paperclip in Annotations.
    When a Word or Excel or Image(png,jpeg) file is attached using the Annotations paperclip, the initiator can initially see and open it. But after Publish Comments is selected and the review file is closed, the file "Name" changes to "Unknown" (although the Description has the correct file name and extension).  The Modified information is Unknown, as is the Size and Compressed Size.
    When the review file is then re-opened, even the initiator cannot open the file, although:
    The file location is marked with the paperclip within the document.
    The file name is shown in the Comments List with the initiator's name.
    In the Attachments list (the paperclip beneath the Thumbnails and Bookmarks) the Name appears as Unknown, Description shows the file name, Modified is Unknown, Size is Unknown, and Compressed Size is Unknown.
    The file Name cannot be edited, although the file Description can be.
    We have followed the procedure described in the tutorials but cannot figure out how to troubleshoot this situation.  Since this feature was the reason for the purchase of Adobe Acrobat Pro IX, we would any help. Please don't leave out any basics since we are all new users.
    We have several people with Adobe Acrobat Pro XI and the rest have Adobe Reader XI and it is a Windows platform.  Can someone please give us some advice how to get this feature to work as described?

    FYI Rave,
    There are some other forum entries with this exact same issue...:
    Cannot Open Attachments in PDF
    Why does the file Name for file attached with Annotations "Attach File" (paperclip) become Unknown when Comments are Published?
    Can someone help us get the COMMENTS ATTACHMENT TOOL to work as described in Acrobat Pro XI?

  • When I open the "Save Page As" window, the drop-down box for the file name shows files that were saved long ago. This is not cleared by any "clear history" function that I can find. How do I clear this?

    # Question
    When I open the "Save Page As" window, the drop-down box for the file name shows files that were saved long ago. This is not cleared by any "clear history" function that I can find. How do I clear this?

    Hello.
    I believe this is a Windows related issue, since it's the windows Save File manager we're talking about here (right?). You should contact Microsoft for help on that one, I believe. You'd expect to be able to delete the entries by simply tapping ''Delete'' on your keyboard when they are focused (that's how it goes for deleting specific form autocomplete entries in Firefox), but I haven't tried that.
    I'm sorry I can't be of more help.

  • Approval History (Workflow History) for a particular version of the PO

    Hello Everyone,
    We are using SRM 5.0 with ECS.
    We need the Approval History (Workflow History) for a particular version of the Purchase Order.
    Is there a way to get that?
    Any FM or table which can give the Approval History for a PO?
    Regards,
    Khushbu.

    LOGIKNR is assigned to only currently installed devices (see entries in EGERH, you will understand). So if you are looking at a record in EGERH and if the field BIS is in future, that is the record that will have the LOGIKNR. All the older records will not have that link. A device is always an equipment and LOGIKNR is always assigned to only installed devices. All other devices do not get that number. Only when you install a device, you will have information like device install date, device location etc. So it is relevant in the other case where device location was also needed.

  • The file name format for Voice Memos has changed - how can I change it to the original format?

    The file names for the voice memos changed in the last update.  Now the day is first, which means when you sort them in a file folder, they sort by the number of the day and not year - month - day as before.  Is there a way to change it back?

    Restore it as new or sign out of that account and into yours.  Both are covered in the manual.
    http://manuals.info.apple.com/en_US/iPod_touch_iOS4_User_Guide.pdf

  • How can I remove the list of 20 recently saved items when you click on the arrow on the far right side of the File Name screen for images, web pages, ect?

    When I right click and go save image/page/ect as the file save popup screen appears and on the right side of the File Name bar there is an arrow. If you click the arrow it shows the last 20? items that have been saved and their save location. Is there anyway to not have the list of recent items there or at the very least a way to clear them? I'm running Firefox 17 on Windows 7.
    Also when you save items as you were typing in the name you want to save them as it used to show filenames with the same name as you type that are saved in that directory so instead of typing the whole filename or copy/pasting you could start typing a filename and then hit the up or down arrow, backspace and just change the end of the filename without having to retype the entire filename.
    Hopefully you understand what I mean and can help me fix it, thanks.

    It's in the proper directory. I can scroll down the window on the right and see the files but if I start typing the file name of one of them the autocomplete drop down thing that shows matching file names does not appear. In the back of my mind I'm starting to think a setting got changed and then the list of matching file names stopped appearing but I can't recall what setting may have been changed, if it was a firefox or microsoft change or for certain if anything got changed at all. Yeah I know I'm not helping my own cause but what can you do.

  • I am using OSX 10.9.5 and Outlook Web App for emails. When I download an attachment it replaces the space in the file name with   - how can I change this?

    I am using OSX 10.9.5 and Outlook Web App for emails. When I download an attachment it replaces the space in the file name with %20  - how can I change this?

    Click on the below link :
    https://get.adobe.com/flashplayer/otherversions/
    Step 1: select Mac OS  X 10.6-`0.`0
    Step 2 : Safari and FIrefox
    Then click on " Download Now"  button.

  • Itunes for WIN7: attempting to copy to disk "..." failed.  The file name was invalid or too long

    itunes for WIN7: attempting to copy to disk "..." failed.  The file name was invalid or too long
    help!!

    Max. path length is 255 characters, or perhaps there are some non-displaying characters hidden there. Try dropping a song you want to add to iTunes into the Automatically to iTunes folder to see if that works any better.
    tt2

Maybe you are looking for

  • How to add the User in customized Group.

    Hi All,      If we create any User in SAP Portal then that user is assigned to everyone group by default.Now i have one custom group,say 'ABC'.what i want is, which ever user is being created through SAP Portal should be added to this group. one way

  • Rules are not working correctly in OCS 10.1.2

    Hi, A few days ago we have encountered a problem in which the BCC rules or any other rules are not processed out of the user's mailbox. For example, a user goes to Oracle Mail (the web access, but not WAC), goes to Filters and creates a new rule for

  • Oracle BPM 10.3 Cannot publish the project

    I'm getting fuego.compiler.InternalException while trying to publish project (see below). Oracle BPM 10.3 installed in AIX 5.3 64-bit and bpmengine is up and running. Appreciate any ideas. Internal error found. This should be reported to Oracle Suppo

  • Page alignment problem

    Hi, I am using RSA 7 for development and having problems with page alignment. html tags rendering first and then the jsf tags.can anyone help me to I solve this problem. thanks in advance Edited by: Dravid1973 on Mar 18, 2008 8:04 AM

  • Where do I sign up for Sufficient Privileges?

    This has been driving me crazy. I have a Mini with a LaCie external drive attached via firewire, an ibook g4 and airport express. Both computers are running 10.4.8. I can connect just fine from the ibook to the mini and to the lacie drive with the mi