Additional Blogs by Members
cancel
Showing results for 
Search instead for 
Did you mean: 
Former Member
0 Kudos

If you want to read a CSV file using the file adapter, file content conversion is the first option which strikes your mind.

If you are comfortable with java coding, here i present you with an alternate solution.

I will show you how to use java mapping to achieve the same.

Below is the content in the csv file which i want to read.

1,rahul,siemens,mumbai

2,consultant,12032005

1,viswanath,sisl,hyderabad

2,systemeng,23052005

'1' is used to identify the header level record and '2' the item level.

Now you have to write the java mapping program which will read this data and create a target xml structure

package TXTMapping;

import java.io.BufferedReader;

import java.io.FileInputStream;

import java.io.FileOutputStream;

import java.io.InputStream;

import java.io.InputStreamReader;

import java.io.OutputStream;

import java.util.Map;

import com.sap.aii.mapping.api.StreamTransformation;

public class TMapping implements StreamTransformation {

private Map map;

       

public void setParameter (Map param){

      map = param;

        }

public void execute (InputStream in, OutputStream out){

  try{

    out.write(""Name""Company""Place""Desgn""Since".xls or .pdf or .txt) and do the conversion in the mapping program.

18 Comments