How to Create a Flat File using FTP/File Adapter

Can any body done workaround on creating the Flat file using FTP/File Adapter?.
I need to create a simple FlatFile either using of delimiter/Fixed length. using the above said adapters we can create XML file, i tried concatinating all the values into a single String and writing into a file, but it does not have proper structure
Can any body help me out on this..
Thanks
Ram

You can create a text schema while creating a File Adapter. If schema is specified for File Adapter, it takes care of converting XML into fixed length or delimited format.
Thanks,
-Ng.

Similar Messages

  • How to create a inputstream without using the file operation

    Hi friends
    In my application, I have to create a Streamsource object using the below constructor:
    public StreamSource(InputStream inputStream)
        Construct a StreamSource from a byte stream. Normally, a stream should be used rather than a reader, so the XML parser can resolve character encoding specified by the XML declaration.
        If this constructor is used to process a stylesheet, normally setSystemId should also be called, so that relative URI references can be resolved.
    Parameters:
        inputStream - A valid InputStream reference to an XML stream.*[http://java.sun.com/j2se/1.4.2/docs/api/javax/xml/transform/stream/StreamSource.html#StreamSource(java.io.InputStream) |http://java.sun.com/j2se/1.4.2/docs/api/javax/xml/transform/stream/StreamSource.html#StreamSource(java.io.InputStream) ]*
    But for creating the inputstream, i am creating a tempory file, ie I am using fileinputstream.
    import java.io.File;
    import java.io.FileInputStream;
    import java.io.StringReader;
    import javax.xml.transform.Source;
    import javax.xml.transform.Transformer;
    import javax.xml.transform.TransformerFactory;
    import javax.xml.transform.stream.StreamResult;
    import javax.xml.transform.stream.StreamSource;
    public class SourceConvertor
        private static Source convertStaxToStream(Source request)
    // here the argument to this method is StaxSource and the return type is StreamSource
            TransformerFactory factory = TransformerFactory.newInstance();
            Transformer transformer = null;
            File fp = null;
            FileInputStream fInp = null;
            try
                transformer = factory.newTransformer();
                fp = new File("tempFile.txt");
                transformer.transform(request, new StreamResult(fp));
                fInp = new FileInputStream(fp);
            } catch (Exception e)
                e.printStackTrace();
            return new StreamSource(fInp);
        public static void main(String args[])
            try
                String message ="<author><name>Rai</name><book>GodOfSmallThings</book></author>";
                Source original = new StreamSource(new StringReader(message));
                Source converted = convertStaxToStream(original);
                TransformerFactory factory = TransformerFactory.newInstance();
                Transformer transformer = factory.newTransformer();
                transformer.transform(converted, new StreamResult(System.out));
            catch (Exception e)
                // TODO Auto-generated catch block
                e.printStackTrace();
    This is not at all a good aproach because evey time it is creating a new file.
    So can anyone suggest a better aproach or idea or a simple code snippet so that i can create the inputstream without creating a temporary file.
    Thanks in advance:
    *[http://www.javamilestone.blogspot.com/  |http://www.javamilestone.blogspot.com/  ] *

    Err, a StreamSource is a Source. Check the Javadoc. You can pass it directly to the transform.

  • How to create a flat files and how i used this

    hi Guys and gals,
    I am david. I want to know how to create a flat files. I don't know about it also. pls explain it and also pls help me to create a flat files. If u have any program for creating pls send me.
    I want to know about retrive the datas from flat files and also insert a record into it.
    pls guide me
    i need this immediately
    david

    void newMethod() throws Exception {
         // Reading from a flat file
         String data;     
         BufferedReader br = new BufferedReader(new FileReader("c:\filename1.txt"));
         while ((data = br.readLine()) != null) {
              System.out.println(data);
         // Writing to a flat file
         BufferedWriter bw = new BufferedWriter(new FileWriter("c:\filename2.txt"));
         bw.write("sample data");
         // After writing the data close the file
         bw.close();
    }

  • How we create a flat file on the application server

    hi,
    how we create a flat file on the application servere,this file have the header data and corresponding item data also.
    i.e. how we use the AT NEW and ATEND. statement in this file creation.
    pls send me some code related to this.
    thanks,
    vipin

    Hi Grafl,
    Chk this link
    Folder creation in AL11 using ABAP program
    try this code.This works on UNIX servers
    data: unixcom like   rlgrap-filename.
    data: begin of tabl occurs 500,       
            line(400),    
          end of tabl.
    dir = unixcom = 'mkdir mydir'. "command to create dir
    "to execute the unix command 
    call 'SYSTEM' id 'COMMAND' field unixcom
                      id 'TAB' field tabl[].
    <b>Reward Points if Useful</b>
    Regards
    Gokul

  • HOW to read file using ftp???

    Hi to all,
    I have problem with reading file using ftp connection, i want to read only 1024 bytes for one time, and i have
    next code wich read this:
    byte buffer[] = new byte[1024];
    while( (readCount = input.read(buffer)) > 0) {
    bos.write(buffer, 0, readCount);
    but I dont know how to put all read data in one byte[] if i dont know length of file.
    I can't do some like: byte file[] = new file[1000000];
    Thanks for all sugestions!

          * Download a file from a FTP server. A FTP URL is generated with the following syntax:
         * <code>ftp://user:password@host:port/filePath;type=i</code>.
          * @param ftpServer FTP server address (incl. optional port ':portNumber').
          * @param user Optional user name to login.
          * @param pwd Optional password for <i>user</i>.
          * @param fileName Name of file to download (with optional preceeding relative path, e.g. one/two/three.txt).
          * @param destination Destination file to save.
         * @throws MalformedURLException, IOException on error.
         public void download(String ftpServer, String user, String pwd, String fileName, File destination) throws MalformedURLException, IOException {
            if (ftpServer != null && fileName != null && destination != null) {
                StringBuffer sb = new StringBuffer("ftp://");
                if (user != null && pwd != null) { //need authentication?
                    sb.append(user);
                    sb.append(':');
                    sb.append(pwd);
                    sb.append('@');
                }//else: anonymous access
                sb.append(ftpServer);
                sb.append('/');
                sb.append(fileName);
                sb.append(";type=i"); //a=ASCII mode, i=image (binary) mode, d= file directory listing
                BufferedInputStream bis = null;
                BufferedOutputStream bos = null;
                try {
                    URL url = new URL(sb.toString());
                    URLConnection urlc = url.openConnection();
                    bis = new BufferedInputStream(urlc.getInputStream());
                    bos = new BufferedOutputStream(new FileOutputStream(destination.getName()));
                    int i;
                    while ((i = bis.read()) != -1) { //read next byte until end of stream
                        bos.write(i);
                    }//next byte
                } finally {
                    if (bis != null) try { bis.close(); } catch (IOException ioe) { /* ignore*/ }
                    if (bos != null) try { bos.close(); } catch (IOException ioe) { /* ignore*/ }
            }//else: input unavailable
        }//download()If you don't want to strore the data into a file, use ByteArrayOutputStream instead of a FileOutputStream.

  • How to download file using ftp in bash script

    Hi! I'm runnig a bash script in solaris i want within the script to dowload file using ftp
    How can i do it?
    Tanks a lot

    hello,evgchech
    please try this way:
    1. In the bash script, try following command:
    ftp -n < ftpcmdfile2 in the ftpcmdfile (which is a file),coding the interactive commands of FTP such as:
    user anonymous  [email protected]
              cd /var/sun/download
              bi
              mget *.*
              bye
         try it and good luck!
    Wang Yu
    Developer Technical Support
    Sun Microsystems
    http://sun.com/developers/support

  • How to upload a file using FTP tin JSP

    Hello friends ,
    I m actually looking to upload a file using FTP to a server(webserver) in JSP . If there any tags available to accomplish this r any information regading this plzz let me no.
    Thanks in advance
    P.Satish

    Not sure exactly what you're trying to do but you set the content type a stream it to the browser from a servlet

  • Getting remote file using FTP Server Issue in OSB

    Hi Guys,
    I have configured a FTP server on my local system and I created a proxy service to get file from ftp location to some other location but it fails . I used ftp protocol for getting file
    and my ftp location is D:\host\ftp and it has another folder called osb . I used ftp as protocol and EndPointURI is ftp://localhost/. It fails to get files and shows error message like
    com.bea.wli.sb.transports.TransportException: <user:osb>Unable to list files for
    directory: .
    at com.bea.wli.sb.transports.ftp.connector.FTPWorkPartitioningAgent.exec
    ute(FTPWorkPartitioningAgent.java:218)
    In case of Business Service, writing a file to ftp location (i.e ftp://localhost/ means D:\host\ftp\osb) working.
    I used service account for both proxy,BS to connect . osb is username and same as password.
    Can Any one please suggest me How to solve this issue?
    Thanks,
    Srinivas.
    Edited by: 863597 on May 22, 2012 1:06 AM

    Hi Vijay Thank you,
    Can we do the pooling directly using FTP protocol like JMS protocol in OSB with out using FTP JCA Adapter.I did in such a way but it fails. For pooling files the mentioned endpoint uri is as ftp://localhost/ and it actual path is D:\host\ftp and ftp has another folder called osb here i have to get the files from this osb Can any one suggest me if there is any problem with the ftp protocol end point.
    Thank You,
    Srinivas.

  • How to create a crystal Report using C# and SQL Server

    Hi, im new in creating crystal report using SQL Server, and im making a project.. and could someone help me how to connect your .sdf (SQL Server File) from the bin to your crystal report? thanks a lot.. i followed some instructions like this one (https://social.msdn.microsoft.com/Forums/vstudio/en-US/48c0dd48-5b23-49da-8601-878f8406125e/how-to-create-a-crystal-report-using-sql-server-visual-c?referrer=http://social.msdn.microsoft.com/Forums/vstudio/en-US/48c0dd48-5b23-49da-8601-878f8406125e/how-to-create-a-crystal-report-using-sql-server-visual-c?referrer=http://social.msdn.microsoft.com/Forums/vstudio/en-US/48c0dd48-5b23-49da-8601-878f8406125e/how-to-create-a-crystal-report-using-sql-server-visual-c?referrer=http://social.msdn.microsoft.com/Forums/vstudio/en-US/48c0dd48-5b23-49da-8601-878f8406125e/how-to-create-a-crystal-report-using-sql-server-visual-c?forum=csharpgeneral)
    but i got an error on the adding of server name and database portion.. thanks a lot in advance

    Hello,
    Crystal Reports are supported on
    http://scn.sap.com/community/crystal-reports.
    Karl
    When you see answers and helpful posts, please click Vote As Helpful, Propose As Answer, and/or Mark As Answer.
    My Blog: Unlock PowerShell
    My Book:
    Windows PowerShell 2.0 Bible
    My E-mail: -join ('6F6C646B61726C406F75746C6F6F6B2E636F6D'-split'(?<=\G.{2})'|%{if($_){[char][int]"0x$_"}})

  • Error while reading raw file created in previous task using raw file destination

    I am reading a flat file and creating an raw file using raw file destination.  path of the raw file is in a variable.  now I am reading the raw file using the rawfile source component. I am able to execute if the .raw file is available.  But
    when we deploy into the production the .raw will be created runtime, so the package is getting failed while evualting the variable which hold the path of the variable.  since the .raw is not available i am not able to proceed further. it's in ssis 2008
    r2
    Error at Load Data [Raw File Source [401]]: File "c:\test123.raw" cannot be opened for reading. Error may occur when there are no privileges or the file is not found. Exact cause is reported in previous error message.
    Error at Load Data [SSIS.Pipeline]: component "Raw File Source" (401) failed validation and returned error code 0x80004005.
    Error at Load Data [SSIS.Pipeline]: One or more component failed validation.
    Error at Load Data : There were errors during task validation.

    I am also using a raw file destination using a variable.
    I have set DelayValidation = true on both the DataFlow task and even the Sequence Container.
    I get the same error when I run the entire ssis package, however
    when I run the individual container or individual task it runs without an error.
    Also, something interesting is the error is not the same path as the variable name.
    Warning: The system cannot find the file specified.
    Error: File "C:\Users\MyName\AppData\Local\Temp\GUIDNumber\\RawFileName" cannot be opened for reading. Error may occur when there are no privileges or the file is not found. Exact cause is reported in previous error message.
    The variable is "C:\Temp\ProjectName\RawFileName"
    I have other RawFile sources in this same project, but only this one file is giving me grief.
    Any other suggestions?  Is this a bug?
    Have you set an expression for connection string property of raw file? Is it based on variable/expression or configuration? If yes, check the value of variable/ expression or configuraton item at runtime by putting a breakpoint in the pre execute event of task
    and make sure path value its getting is correct. It may be that path is getting a different value at runtime due to expression/configuration set for it.
    Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs

  • Use temporary file in FTP receiver adapter

    Hi guys,
    I'm not getting the purpose of "use temporary file" in FTP receiver adapter. Can you describe any situation, where this should be used?
    What is the location of this temporary file?
    Is it deleted after "normal" file is created?
    Thanks a lot,
    Olian

    > I'm not getting the purpose of "use temporary file" in FTP receiver adapter. Can you describe any situation, where this should be used?
    Some times when you create the file on your target dir then if there is another application looking for same file is quite faster to pick the file before it is complety written on target dir then in this situation using temporary file option is very helpful. What it does, it simply creates the file first by using temporary name once all bytes or bits has been transfered then it creates the original name and the temp file get deleted.
    > What is the location of this temporary file?
    Same location, where your original file is suppose to be written.
    > Is it deleted after "normal" file is created?
    Yes.
    Regards,
    Sarvesh

  • Dowload file using ftp in bash script

    Hi! I'm runnig a bash script in solaris i want within the script to dowload file using ftp
    How can i do it?
    Tanks a lot

    hello,evgchech
    please try this way:
    1. In the bash script, try following command:
    ftp -n < ftpcmdfile2 in the ftpcmdfile (which is a file),coding the interactive commands of FTP such as:
    user anonymous  [email protected]
              cd /var/sun/download
              bi
              mget *.*
              bye
         try it and good luck!
    Wang Yu
    Developer Technical Support
    Sun Microsystems
    http://sun.com/developers/support

  • How to create standby database by using duplicate

    Dear all,
    How to create standby database by using duplicate,is there some doc to read?

    Hi;
    You can use
    Step-By-Step Guide To Create Physical Standby On Normal File System For ASM Primary using RMAN [ID 838828.1]
    Creating Physical Standby using RMAN Duplicate Without Shutting down The Primary [ID 789370.1]
    Also use goole, there are many blog-site-dogs mention that topic. From googling:
    Creating a Standby Database with Recovery Manager
    http://docs.oracle.com/cd/B19306_01/backup.102/b14191/rcmdupdb.htm
    http://www.pythian.com/news/248/recipes-for-creating-a-managed-standby-with-rman/
    http://docs.oracle.com/cd/B19306_01/server.102/b14239/rcmbackp.htm
    Regard
    Helios

  • How to create OEMS JMS In-Memory and File-Based Persistence?

    Anyone knows how to create OEMS JMS In-Memory and File-Based Persistence? Any help it is appreciated. I m working with Oracle BAM 11g TP4 and I want to test the capability of connecting directly to a JMS queue, and reading Oracle´s "complex" documentation I couldnt find the right way to make this happen.
    tks

    Hi Mario
    This is explained in the soa developer's guide. Chapter 43 "Enterprise message source"should help you. You will find how to connect OEMS or JMS in-memory/file based to your BAM data objects with or without xpath transformation.
    You can find sample of advanced XML formating in the 10g tech note: "Oracle BAM 10.1.3 configuration for BPEL 10.1.2 using JMS sensors" (useful even if you don't plan to use BPEL).
    Anyway, if you plan to use BPEL, forget JMS and use the BAM adapter (chapter 42), it's quicker & easier.
    Dominique

  • How to create OEMS JMS In-Memory and File-Based Persistence ? Anyone?

    Anyone knows how to create OEMS JMS In-Memory and File-Based Persistence? Any help it is appreciated. I m working with Oracle BAM 11g TP4 and I want to test the capability of connecting directly to a JMS queue, and reading Oracle´s "complex" documentation I couldnt find the right way to make this happen.
    tks

    Hi Mario
    This is explained in the soa developer's guide. Chapter 43 "Enterprise message source"should help you. You will find how to connect OEMS or JMS in-memory/file based to your BAM data objects with or without xpath transformation.
    You can find sample of advanced XML formating in the 10g tech note: "Oracle BAM 10.1.3 configuration for BPEL 10.1.2 using JMS sensors" (useful even if you don't plan to use BPEL).
    Anyway, if you plan to use BPEL, forget JMS and use the BAM adapter (chapter 42), it's quicker & easier.
    Dominique

Maybe you are looking for

  • Benefits enrollment for a single employee without spouse

    Currently on ECC6 (ERP 2005) and EP7......We have an enrollment reason for "anytime" reasons and within that, several plans are offered, one of which is spouse life insurance. On the backend, this works fine (ie. via PA20/30) however, for the ESS sid

  • HT1918 can I use an Itunes gift card to open my Itunes account?

    I don't want to use a credit card, do I have other options for opening an Itunes acct? Thank you.

  • Satellite A500 - screen goes black

    My wife and i have had ours four weeks and getting same thing happening. Dont know why. also battery only lasts an hour when using and 2 hrs when not in use.

  • Payment term - OBB8

    hi we have in OBB8 a 200 payment terms for vendors and customers from this 200 only 30 are in used from 1.1.2010. our users wants to see when they go to transaction MIRO/ME23N or any other transaction that have the field "payment term" only this 30 t

  • Measure data through XI per interface/communication channel

    Is there a way to measure the data through XI per interface/communication channel. SXMS_XI_AUDIT_DISPLAY gives you a list of the total throughput in XI, but I would like this to be specified per interface or communication channel. Is this possible? R