How can i read only .txt file and skip other files in Mail Sender Adapter ?

Hi Friends ,
                   <b> I am working on scenario like , I have to read an mail attachement and send the data to R3.</b>
                    It is working fine if only the .txt file comes.
                  <b>Some times ,html files also coming along with that .txt files. That time my Mail adapter fails to read the .txt file.</b>
                   I am using PayLoadSwap Bean and MessageTransformBean to swap and send the attachment as payload .
                     <b>Michal as told to write the Adapter module to skip the files .But i am not ware of the adapter moduel . If any blogs is there for this kind of scenarios please give me the link.</b>
                       Otherwise , please tell me how to write adapter module for Mail  Sender Adapter?
                  How to download the following
                    newest patch of XI ADAPTER FRAMEWORK CORE 3.0
from SAP Service Marketplace. Open the file with WinZip and extract the following
SDAs:
&#61589;&#61472;aii_af_lib.sda, aii_af_svc.sda
&#61589;&#61472;aii_af_cpa_svc.sda
                    I have searche in servive market place .But i couldn't find that . Can you please provide me the link to download the above .
                  If any other suggestions other than this please let me know.
Regards.,
V.Rangarajan

=P
Dude, netiquette. Messages like "i need this now! Do it!" are really offensive and no one here is being payed to answer anyone's questions. We're here because we like to contribute to the community.
Anyway, in your case, just perform some search on how you could filter the files that are attached to the message. The sample module is just an example, you'll have to implement your own. Tips would be to query the filename of the attachments (or maybe content type) and for the ones which are not text, remove them.
Regards,
Henrique.

Similar Messages

  • When sending e-mails, how can I show only the name and not include the e-mail address?

    When sending e-mails, how can I show only the name of the recipient and not include their full e-mail address?

    Hi beverlyfromnull,
    Have you added the recipients to your address book?

  • How can I extract only the audio as an aiff file?

    Using a Sony DSC-N2 Cybershot Camera I recorded video that was saved as “MOV01606.MPG”. The video plays back with sound in Quicktime Pro and iTunes but how can I extract only the audio as an aiff file?

    Use MPEG Streamclip (free) to convert your .mpg files to QuickTime formats.
    QuickTime can't extract audio from muxed file formats.

  • How can I delete only one part of my xml file?

    Hello,
    I stored more than 100 users in only one xmltype column. For instance
    Create table agro(users XMLTYPE);
    ... and I inserted all users inside
    INSERT INTO agro values(XMLTYPE
    ('<?xml version="1.0" encoding="ISO-8859-1"?>
    <authentication><users><user>
    <name>cocoon</name>
    <password>cocoon</password>
    <role>admin</role>
    <title>Mr.</title>
    <firstname>Walter</firstname>
    <lastname>Cocoon</lastname>
    <company />
    <street />
    <zipcode />
    <city />
    <country>DE</country>
    <phone />
    <fax />
    <email />
    <bankid />
    <bankname />
    <accountid />
    </user>
    ... another user, etc.
    </users></authentication>'));
    Now I tried to delete only one part of this file. For example all persons with the name"cocoon".
    I used for this target the following statement:
    DELETE FROM agro agro
    WHERE agro.users.extract('authentication/users/user/text()').getStringVal()= 'cocoon';
    When I execute this statement, Oracle DB delete all users and not only with the name "Cocoon".
    How can I delete only one part of my xml file?
    Kind Regards
    M R

    This the expected behavoir. You uploaded a document containing multiple users and then asked XML DB to delete any documnet that contained a user with the name in question. The problem here is that you are creating a mega document that contains an aggregation of user documents but then trying to work with individual user documents. This is a bad idea.
    In general XML does not understand the concept of a collection of documents. It can only operate on one document at a time. Hence the tendancy to aggregate individual documents into a single larger document. Once you have an XML database, you can perform operations on collections of document, as easily as you can perform operations on individual documents, so the need to aggregate the individual documents together disappears.
    If you store each user document as a seperate document then your delete will work as expected.

  • How can i reply to an email and attach a file to it?

    How can i reply to an email and attach a file to it?

    http://www.apple.com/feedback/
    Tell Apple. We're just fellow users here and can't control a thing. The sandboxed nature of the iPad, which also means a lack of an overall file manager is what keeps viruses from spreading and improves the stability of the system as a whole. And it's that lack of a file manager system that means you can't just attach something to an e-mail.
    What I'd do, reply to the person, i'm sending the attachment next, do that and you're done. 2 e-mails sure but you've accomplished what you need to do.

  • I have downloaded a music file through a downloader . But the file is not found in the captured in music player . How can I locate the physical location and move the file . I cannot do via itunes also .

    I have downloaded a music file through a downloader . But the file is not found in the captured in music player . How can I locate the physical location and move the file . I cannot do via itunes also .

    Exactly what do you mean by a 'downloader'?
    Thanks
    Pete

  • How can I read only text files in a directory.

    I've written a program to read files in a directory but I'd like for it to only read the text files of that directory.
    import java.io.*;
    public class Data {
      public static void main(String[] args) throws IOException {
      String target_dir = "C:\\files";
      File dir = new File(target_dir);
      File[] files = dir.listFiles();
      for (File textfiles : files) {
      if (textfiles.isFile()) {
      BufferedReader inputStream = null;
      try {
      inputStream = new BufferedReader(new FileReader(textfiles));
      String line;
      while ((line = inputStream.readLine()) != null) {
      System.out.println(line);
      } finally {
      if (inputStream != null) {
      inputStream.close();

    You have mentioned you want to read only text files.
    If you are referring to some specific set of extentions, you can filter based on that.
    ex: you want to read only .txt files, you can add an if condition as below :
              if(textfiles.getName().endsWith(".txt")) {
                  // Add your code here
    Cheers
    AJ

  • How can I read a line of numbers in a file?

    Hello everybody,
    I have a ziped.file organized in this way:
    number1 number 2 number3 name1, name2, name3
    number_of points information_about_number_of_point
    number4 number4 number4 number4
    number4 number4 number4 number4
    number4 number4
    number5 number5 number5 number5 number5 number5
    number5 number5 number5 number5 number5 number5
    number5 number5 number6 number6 number6 number6
    number6 number6 number6 number6 number6 number6
    number6 number6
    My problem is to save number1 number 2 number3 and in number_of points in 3 different variable, and number4 number5 and number 6 in 3 different array. How can I do this?
    The beginning of my file is:
    10000 3.50000 0.00000 Teff, logg, [M/H]
    52790 number of wavelength points
    1.000000000000000e+01 1.200000000000000e+01 1.400000000000000e+01 1.600000000000000e+01 (end of3th line)
    1.800000000000000e+01 2.000000000000000e+01 2.200000000000000e+01 2.400000000000000e+01 (end of 4th line)
    The number 52790 is the same for number4, number 5 and number6.
    Number4 are organized in 4 columns, number5 and 6 in 6 coloums and the spacing is always the same.
    Could you help me please?Thank you and sorry for my terrible english!

    I'm not sure if I understand completely, but basically you just need to read & parse your files.
    Use a lexer/parser tool like JavaCC if it's advanced parsing, or if it's something very simple (like assigning variables) then you can just use the String.split() method to break up your file into tokens. See below for examples of the "simple way"...
    If you have any questions, don't hesitate to ask!
    I need to save my informazioni in this way:
    var1=number1
    var2=number2
    var3=number3If you wish to access these variables in a Java program, you could split up your file into tokens and then place the values in a map (variable/value pairs). I don't know how efficient this is, but it works nicely. You can change this for arrays, objects, etc.. right now it's only set up for ints.
    Here's a very simple example with some code. Below is the text file...
    my_var = 123
    my_age = 16
    x_pos  = 2
    err=2 //syntax error. must separate tokens with whitespaceTo get your variables from the text file:
    Map<String, Integer> map;
    //read text file and put it into string
    //then use tokenExample to get a Map for that string
    map = tokenExample(textfileString); //see below
    //and finally assign your variables
    int my_var = map.get("my_var");
    int my_age = map.get("my_age");
    int x_pos  = map.get("x_pos");
    The tokenExample(String) method
    This method breaks the speified string into tokens, and returns a Map with all of the variable name/value pairs in the string.
      public static Map<String, Integer> tokenExample(String text) {
           //Sets up our tokens.
         final String ASSIGN   = "=";
           final String NUMBER   = "\\d+";
           final String VARIABLE = "[a-zA-Z]([a-zA-Z]|_|[0-9])*";       
           //Map for our variable/value pairs
           Map<String, Integer> variables = new Hashtable<String, Integer>();
           String[] splitText = text.split("\\s+"); //Splits by whitespace
           String varName = null;
           boolean assigning = false;
           //cycles through each token and decides what to do
           for(String value : splitText) {        
             //if it's a variable, we set up it's name for later
             if (value.matches(VARIABLE)) {
              varName = value;
             //if it's an assignment operator, we get ready to assign the variable
             else if (value.matches(ASSIGN)) {
               assigning = true;
             //if it's a number, we put it into our hashmap
             else if (value.matches(NUMBER)) {
                  //if there's no problem with the last two tokens
               if (varName!=null & assigning==true) {
                 variables.put(varName, Integer.parseInt(value));
                 assigning=false; //reset for next time
                 varName=null;
             //some sort of syntax error
             else {
               assigning=false;
               varName=null;
               System.err.println("Syntax error: cannot find token "+value);
           }//end loop
           return variables;
      }See also:
    http://mindprod.com/jgloss/regex.html
    http://java.sun.com/docs/books/tutorial/extra/regex/
    http://www.javaregex.com/tutorial.html

  • How can I show only text edits and not text formatting when using print comments summary?

    Acrobat 9.3.0 for Mac.
    Here is the scenario: I used the Compare command to see the changes between 2 PDFs. The resulting file some edits are inserts and some are deletions. I want to print a comments summary only showing the text edits. In the Compare Option pane, I select Text and deselect Images, Annotations, Formatting, Headers/Footers, and Backgrounds. Now on the screen I see inserts are highlighted in blue and deletions are marked with sort of a caret and vertical bar symbol. So all looks good at this point. However, when I show the Comments List, I see addtional comments that indicate "Replace - The following text attributes were changed: fill color." Those comments do not appear in the page view unless I check the Formatting check box to show them. With Formatting unchecked, I print a comments summary and all of the "Replace - Fill Color" comments" appear on the resulting comments summary.
    I only want to show text edits, not text formatting changes. So questions are:
    1. Why, when the Formatting checkbox is unchecked, do the text formatting comments still appear in the comments list when they do not appear on the page display.
    2. How can I print only the text content edits and not show the text formatting changes when using Print Comments Summary.

    Hi,
    You can set ExecuteWithParams as default activity in the task flow then method activity to return total no of rows passing to Router activity if your method has value 0 then call Create insert operation else do directly to page.
    Following idea could be your task flow
    Execute With param (default) > SetCurrentRowWithKey > GetTotalNoOfRows (VOImpl Method)
    |
    v
    Router
    1. If pageFlowScope outcome is 0 then call CreateInsert > MyPage
    2. if pageFlowScope outcome > 0 then MyPage
    hope it helps,
    Zeeshan

  • How can I read a specific character from a text file?

    Hi All!
    I would like to read a specific character from a text file, e.g. the 2012th character in a text file with 7034 characters.
    How can I do this?
    Thanks
    Johannes

    just use the skip(long) method of the input stream that reads the text file and skip over the desired number of bytes

  • How can i read every"number" value and not only the 1st?

    in the vi only the first "number" value(from the data acquisition)is read in the small loop.how can i make every value to be read?every value must be compared with the "numeric" constant,and,if greater the led must turn on.afterwards,when a value which is less than the "numeric" is found the led must turn off.please answer or send mail to [email protected]
    Attachments:
    oximet5.vi ‏152 KB

    The more I look at your program, the less I understand it.
    Why are you setting number = number in a case if SO2 = ""? number always equals number.
    In your sequence frames 1 and 4, you have no control over which write (date or time) happens first. Just placing one function to the left of another doesn't make it happen first if your wiring doesn't create data dependency. Review the section on Data Dependency in chapter 5 of the LabView User's Manual.
    It looks you're writing to and reading from the same file using Write File and Read Lines from File.vi. Why read back data you just wrote? You have the data on your diagram. If you want to convert it from string to numeric, use a Sring/Number Conversion function from the String palette.
    On Read Lines from File.vi (which I'm not sure you even need), you should use a shift register for the start of read offset rather than a local variable for mark after read (chars.). With a shift register, you can initialize it to 0 when the VI starts. Using a local, if you restart the VI, it will try to startup from where you left off the last time, but you just opened the file for create or replace.
    In your sequence frames 2 and 3, why do you wait for the number to be less than the numeric before writing a carriage return to the file? Also, LabView has a End of Line constant which adapts to the expected value for the operating system. That's generally more flexible than a Carriage Return.
    It looks to me like you're overusing control refnums. You don't need to use a control refnum and a property node to set or read a control's value if you can wire directly to the control's terminal.
    I really don't understand what you're doing with pause and variants. I may be missing the point, but it looks like you made this much more complicated than it needs to be. Why not keep it a boolean?
    For your pause-path, you open the file but never close it. You can lose data that way. You also open it using open function 3, create new file. You'll get an error if the file already exists.
    On a general note, your diagram would be easier to read if you were more selective in how you routed your wires: you have wires on top of wires, wires running under sub-VIs, wires running in the frame of a while loop, wires running under labels.
    I think there's a temptation to overuse sequences. I don't think you need one here. As I mentioned in my earlier message, case structures and shift registers will be more useful to you.

  • How can I read, millions of records and write as *.csv file

    I have to return some set of columns values(based on current date) from the database (could be million of record also) The dbms_output can accomodate only 20000 records. (I am retrieving thru a procedure using cursor).
    I should write these values to a file with extn .csv (comma separated file) I thought of using a utl_file. But I heard there is some restriction on the number of records even in utl_file.
    If so, what is the restriction. Is there any other way I can achive it? (BLOB or CLOB ??).
    Please help me in solving this problem.
    I have to write to .csv file, the values from the cursor I have concatinated with "," and now its returning the value to the screen (using dbms_output, temporarily) I have to redirect the output to .csv
    and the .csv should be in some physical directory and I have to upload(ftp) the file from the directory to the website.
    Please help me out.

    Jimmy,
    Make sure that utl_file is properly installed, make sure that the utl_file_dir parameter is set in the init.ora file and that the database has been re-started so that it will take effect, make sure that you have sufficient privileges granted directly, not through roles, including privileges to the file and directory that you are trying to write to, add the exception block below to your procedure to narrow down the source of the exception, then test again. If you still get an error, please post a cut and paste of the exact code that you run and any messages that you received.
    exception
        when utl_file.invalid_path then
            raise_application_error(-20001,
           'INVALID_PATH: File location or filename was invalid.');
        when utl_file.invalid_mode then
            raise_application_error(-20002,
          'INVALID_MODE: The open_mode parameter in FOPEN was
           invalid.');
        when utl_file.invalid_filehandle then
            raise_application_error(-20002,
            'INVALID_FILEHANDLE: The file handle was invalid.');
        when utl_file.invalid_operation then
            raise_application_error(-20003,
           'INVALID_OPERATION: The file could not be opened or
            operated on as requested.');
        when utl_file.read_error then
            raise_application_error(-20004,
           'READ_ERROR: An operating system error occurred during
            the read operation.');
        when utl_file.write_error then
            raise_application_error(-20005,
                'WRITE_ERROR: An operating system error occurred
                 during the write operation.');
        when utl_file.internal_error then
            raise_application_error(-20006,
                'INTERNAL_ERROR: An unspecified error in PL/SQL.');

  • How can I read only a line of text from a file, line by line using Scanner?

    Here's the code I currently have for a program that finds a keyword from numerous files and prints every line in every file that has that keyword. The keyword is indicated by the first parameter in a command line and the files are every parameter after that. Right now, with the code I have, the program will not print multiple lines of each file if they contain the keyword. I am trying to solve this problem by figuring out a way to have a loop continue until an \n EOL character is found. I am not sure how to do this though. Here's the portion of code that I would like to change to do this. I need to add a condition somewhere after in.hasNext() I think to stop when it it hits a /n.:
    while (in.hasNext()) {
                        count++;
                        String nextWord = in.next();
                        lineOfText.add(nextWord);
                        if (nextWord.equals(keyword)) {
                            flag = true;
    import java.util.Scanner;
    import java.io.IOException;
    import java.io.FileNotFoundException;
    import java.io.FileInputStream;
    import java.io.PrintWriter;
    import java.util.ArrayList;
    public class Find {
        static ArrayList<String> lineOfText = new ArrayList<String>();
        static boolean flag = false;
        public static void main(String args[]) {
                   run(args);
        public static void run(String args[]) {
            try {
                PrintWriter out = new PrintWriter("output.txt");
                String keyword = args[0];
                for (int i = 1; i < args.length; i++) {
                    Scanner in = new Scanner(new FileInputStream(args));
    int count = 0;
    while (in.hasNext()) {
    count++;
    String nextWord = in.next();
    lineOfText.add(nextWord);
    if (nextWord.equals(keyword)) {
    flag = true;
    if (flag == true) {
    System.out.print(args[i] + ": " );
    out.print(args[i] + ": " );
    for (String s : lineOfText) {
    System.out.print(s + " ");
    out.print(s + " ");
    System.out.print("\n");
    out.println(" ");
    lineOfText.clear();
    out.close();
    catch (FileNotFoundException e) {
    System.out.println("file not found!");
    catch (IOException e) {
    System.out.println(e);
    Thanks

    Well, I thought I had this program finished, then I realized I need to match the keyword anywhere in the file(including within a word) and print out each line that "contains" the keyword in each file. So, I need some way of testing to see if the keyword is a part of each word and then flag the line that contains the keyword. Is there some method to do this? Thanks
    Here's the code I have now:
    import java.util.Scanner;
    import java.io.IOException;
    import java.io.FileNotFoundException;
    import java.io.FileInputStream;
    import java.io.PrintWriter;
    public class Find {
        static String line = "";
        static boolean flag = false;
        static boolean flag2 = false;
        public static void main(String args[]) {
                    run(args);
        public static void run(String args[]) {
            try {
                PrintWriter out = new PrintWriter("output.txt");
                String keyword = args[0];
                System.out.print("Searching for the keyword: " + keyword);
                out.print("Searching for the keyword: " + keyword);
                System.out.print("  in files: ");
                out.print("  in files: ");
                for (int k = 1; k < args.length; k++)
                     System.out.print(args[k] + " ");
                     out.print(args[k] + " ");
                     System.out.println("\n");
                     out.println("");
                     out.println("");
                for (int i = 1; i < args.length; i++) {
                    Scanner in = new Scanner(new FileInputStream(args));
    while (in.hasNextLine()) {
    line = in.nextLine();
    String[] splitLine = line.split(" ");
    for (int j=0; j < splitLine.length; j++) {
    if (splitLine[j].equals(keyword) && flag2 == false) {
    flag = true;
    flag2 = true;
    System.out.print(args[i] + ": " + line + "\n");
    out.println(args[i] + ": " + line);
    flag2 = false;
    System.out.print("\n");
    out.println(" ");
    out.close();
    catch (FileNotFoundException e) {
    System.out.println("file not found!");
    catch (IOException e) {
    System.out.println(e);

  • How can I save ONLY the bookmarks and extensions

    I am about to do a clean reinstall of Firefox. I want to save ONLY the Bookmarks and Extensions and NOTHING ELSE from the Firefox Profile. How can I do this please?
    Thank you,

    Both answers combined to help solve the problem. It would be good if more than one answer can be selected as "Chosen Solutions", because this situation occurs often in forums.
    Thank you to both of you!
    Kind regards.

  • How can I read font in Photoshop and Bridge CS5 (illustrator is big enough)

    I have upgraded my PC to windows 8, and now Font size is  about size 2 - I can not read the font, this is a huge problem. HUGE. I have managed to get Microsft help via phone, they suggest reducing the screen resolution, but this makes everything BLURREY, so that is not an option when working with Graphics.
    I really need a solution to this??

    Emily Bieman wrote:
    Correction to that last response, after doing screen shots with all font sizes chosen, I note there is a SLIGHT difference in the font in the dialog box, but not the interface ontop of the screen, : ie FILE, EDIT, IMAGE, LAYER ect, accross the top of the screen.
    When I say slight, it was so slight I could not notice it until I zoomed in on my screen shot.
    If you have 20/20 vision, yet still are looking at these tiny fonts, it is doing your eyes harm, you are straining your eyes each time you work in photoshop, thus damaging your eyes.
    I can't beleive I am the only person that seems to be concerned about this
    Like I said in reply #3, get a monitor with larger pixels.

Maybe you are looking for