Reading a txt file into a text member with BuddyAPI.

Hi I have this:
mFile =_movie.path &"TheTEXT.txt"
theFile = baShell("open", mFile, "", "", "normal")
which opens a txt file in note pad. I don't have an idea on how to do this with API to be opened into a txt member.
Thanks
Brian

You don't need Buddy API to import text (which is what you appear to be trying to do) - just set the filename of an existing (or new) text member to the file:
-- tTextMember = _movie.newMember(#text)
tTextMember.filename = _movie.path & "TheText.txt"
tText = tTextMember.text

Similar Messages

  • Reading entire txt file into memory?

    When you are using BufferedReader to read info into a buffer, that means you are reading the file into memory, correct? (Is that what buffer means?)
    I want to look for pattern matches in text files (about 1000 of them) using the regex utils. But I don't want to read and examine the text files line by line. I want to read in the entire text file into memory first and then look for the pattern matches. The text files generally don't exceed about 15K in size. I'm only going one file at a time, too, so this won't give me any out of memory errors, will it?
    And more importantly, how do I do it? I mean the "reading in the file" part only. I have my RegEx, I have my array of files to examine already. I just can't figure out the right code to use to read each file into memory before I look for pattern matches.
    Could someone help, please?

    When you are using BufferedReader to read info into a
    buffer, that means you are reading the file into
    memory, correct? (Is that what buffer means?)Yes.
    I want to look for pattern matches in text files
    (about 1000 of them) using the regex utils. But I
    don't want to read and examine the text files line by
    line.Why not?
    I want to read in the entire text file into
    memory first and then look for the pattern matches.Why?
    The text files generally don't exceed about 15K in
    size. I'm only going one file at a time, too, so
    this won't give me any out of memory errors, will
    it?Depends on how much memory you've given the VM and how much of that it's using already at the time you read the files, but in general, probably not a problem.
    And more importantly, how do I do it? I mean the
    "reading in the file" part only.Use BufferedReader to read line by line and then append each line (plus a newline, since BR.readLine() strips those off) to a StringBuilder.
    Or use a BufferedInputStream and and array that's as big as the file, and in a loop, try to read as much as is left into that array at an offset equal to how much has been read so far.
    I still think this is probably not a good approach though.

  • Help! How to read a .txt file into a Java class and make 2D array?

    Hi guys,
    Im a newbie with arrays, just started really using them.. please bear with me if I don't seem to understand much..
    I have a .txt file that contains either a square or rectangle (random width and length).. How can I read each line into a Java class into a 2D array with rows and columns?

    Example :
    import javax.swing.*;
    import java.util.ArrayList;
    import java.io.BufferedReader;
    import java.io.FileReader;
    import java.io.File;
    public class ReadInto2DArrayExample {
        public static void main(String[] args) {
            ArrayList array = new ArrayList();
            char [][] twoDimesionArray = null;
            try
                JFileChooser fileChooser = new JFileChooser();
                if (fileChooser.showOpenDialog(null) == JFileChooser.APPROVE_OPTION)
                    File file = fileChooser.getSelectedFile();
                    BufferedReader reader = new BufferedReader(new FileReader(file));
                    String data;
                    //Read from file
                    while ((data = reader.readLine()) != null)
                        //Convert data to char array and add into array
                        array.add(data.toCharArray());
                    reader.close();
                    //Creating a 2D char array base on the array size
                    twoDimesionArray = new char [array.size()][];
                    //Convert array from ArrayList to 2D array
                    for (int i = 0; i < array.size(); i++)
                        twoDimesionArray[i] = (char [])array.get(i);
                    //Test the 2D Array
                    for (int y = 0; y < twoDimesionArray.length; y++)
                        char [] temp = twoDimesionArray[y];
                        for (int x = 0; x < temp.length; x ++ )
                            System.out.print(temp[x]);
                        System.out.println("");
            catch (Exception ex)
                ex.printStackTrace();
    }

  • Problem reading .txt-file into JTable

    My problem is that I�m reading a .txt-file into a J-Table. It all goes okay, the FileChooser opens and the application reads the selected file (line). But then I get a Null Pointer Exception and the JTable does not get updated with the text from the file.
    Here�s my code (I kept it simple, and just want to read the text from the .txt-file to the first cell of the table.
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import javax.swing.event.*;
    import javax.swing.table.*;
    import java.util.*;
    import java.lang.*;
    import java.io.*;
    public class TeamTable extends JFrame implements ActionListener, ItemListener                {
    static JTable table;
         // constructor
    public TeamTable()                {
    super( "Invoermodule - Team Table" );
    setSize( 740, 365 );
              // setting the rownames
    ListModel listModel = new AbstractListModel()                     {
    String headers[] = {"Team 1", "Team 2", "Team 3", "Team 4", "Team 5", "Team 6", "Team 7", "Team 8", "Team 9",
    "Team 10", "Team 11", "Team 12", "Team 13", "Team 14", "Team 15", "Team 16", "Team 17", "Team 18"};
    public int getSize() { return headers.length; }
    public Object getElementAt(int index) { return headers[index]; }
              // add listModel & rownames to the table
              DefaultTableModel defaultModel = new DefaultTableModel(listModel.getSize(),3);
              JTable table = new JTable( defaultModel );
              // setting the columnnames and center alignment of table cells
              int width = 200;
              int[] vColIndex = {0,1,2};
              String[] ColumnName = {"Name Team", "Name Chairman", "Name Manager"};
              TableCellRenderer centerRenderer = new CenterRenderer();          
              for (int i=0; i < vColIndex.length;i++)          {
                             table.getColumnModel().getColumn(vColIndex).setHeaderValue(ColumnName[i]);
                             table.getColumnModel().getColumn(vColIndex[i]).setPreferredWidth(width);
                             table.getColumnModel().getColumn(vColIndex[i]).setCellRenderer(centerRenderer);
              table.setFont(new java.awt.Font("Dialog", Font.ITALIC, 12));
              // force the header to resize and repaint itself
              table.getTableHeader().resizeAndRepaint();
              // create single component to add to scrollpane (rowHeader is JList with argument listModel)
              JList rowHeader = new JList(listModel);
              rowHeader.setFixedCellWidth(100);
              rowHeader.setFixedCellHeight(table.getRowHeight());
              rowHeader.setCellRenderer(new RowHeaderRenderer(table));
              // add to scroll pane:
              JScrollPane scroll = new JScrollPane( table );
              scroll.setRowHeaderView(rowHeader); // Adds row-list left of the table
              getContentPane().add(scroll, BorderLayout.CENTER);
              // add menubar, menu, menuitems with evenlisteners to the frame.
              JMenuBar menubar = new JMenuBar();
              setJMenuBar (menubar);
              JMenu filemenu = new JMenu("File");
              menubar.add(filemenu);
              JMenuItem open = new JMenuItem("Open");
              JMenuItem save = new JMenuItem("Save");
              JMenuItem exit = new JMenuItem("Exit");
              open.addActionListener(this);
              save.addActionListener(this);
              exit.addActionListener(this);
              filemenu.add(open);
              filemenu.add(save);
              filemenu.add(exit);
              filemenu.addItemListener(this);
    // ActionListener for ActionEvents on JMenuItems.
    public void actionPerformed(ActionEvent e) {       
         String open = "Open";
         String save = "Save";
         String exit = "Exit";
              if (e.getSource() instanceof JMenuItem)     {
                   JMenuItem source = (JMenuItem)(e.getSource());
                   String x = source.getText();
                        if (x == open)          {
                             System.out.println("open file");
                        // create JFileChooser.
                        String filename = File.separator+"tmp";
                        JFileChooser fc = new JFileChooser(new File(filename));
                        // set default directory.
                        File wrkDir = new File("C:/Documents and Settings/Erwin en G-M/Mijn documenten/Erwin/Match Day");
                        fc.setCurrentDirectory(wrkDir);
                        // show open dialog.
                        int returnVal =     fc.showOpenDialog(null);
                        File selFile = fc.getSelectedFile();
                        if(returnVal == JFileChooser.APPROVE_OPTION) {
                        System.out.println("You chose to open this file: " +
                   fc.getSelectedFile().getName());
                        try          {
                             BufferedReader invoer = new BufferedReader(new FileReader(selFile));
                             String line = invoer.readLine();
                             System.out.println(line);
                             // THIS IS WHERE IT GOES WRONG, I THINK
                             table.setValueAt(line, 1, 1);
                             table.fireTableDataChanged();
                        catch (IOException ioExc){
                        if (x == save)          {
                             System.out.println("save file");
                        if (x == exit)          {
                             System.out.println("exit file");
    // ItemListener for ItemEvents on JMenu.
    public void itemStateChanged(ItemEvent e) {       
              String s = "Item event detected. Event source: " + e.getSource();
              System.out.println(s);
         public static void main(String[] args)                {
              TeamTable frame = new TeamTable();
              frame.setUndecorated(true);
         frame.getRootPane().setWindowDecorationStyle(JRootPane.FRAME);
              frame.addWindowListener( new WindowAdapter()           {
                   public void windowClosing( WindowEvent e )                {
         System.exit(0);
    frame.setVisible(true);
    * Define the look/content for a cell in the row header
    * In this instance uses the JTables header properties
    class RowHeaderRenderer extends JLabel implements ListCellRenderer           {
    * Constructor creates all cells the same
    * To change look for individual cells put code in
    * getListCellRendererComponent method
    RowHeaderRenderer(JTable table)      {
    JTableHeader header = table.getTableHeader();
    setOpaque(true);
    setBorder(UIManager.getBorder("TableHeader.cellBorder"));
    setHorizontalAlignment(CENTER);
    setForeground(header.getForeground());
    setBackground(header.getBackground());
    setFont(header.getFont());
    * Returns the JLabel after setting the text of the cell
         public Component getListCellRendererComponent( JList list,
    Object value, int index, boolean isSelected, boolean cellHasFocus)      {
    setText((value == null) ? "" : value.toString());
    return this;

    My problem is that I�m reading a .txt-file into a J-Table. It all goes okay, the FileChooser opens and the application reads the selected file (line). But then I get a Null Pointer Exception and the JTable does not get updated with the text from the file.
    Here�s my code (I kept it simple, and just want to read the text from the .txt-file to the first cell of the table.
    A MORE READABLE VERSION !
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import javax.swing.event.*;
    import javax.swing.table.*;
    import java.util.*;
    import java.lang.*;
    import java.io.*;
    public class TeamTable extends JFrame implements ActionListener, ItemListener                {
    static JTable table;
         // constructor
        public TeamTable()                {
            super( "Invoermodule - Team Table" );
            setSize( 740, 365 );
              // setting the rownames
            ListModel listModel = new AbstractListModel()                     {
                String headers[] = {"Team 1", "Team 2", "Team 3", "Team 4", "Team 5", "Team 6", "Team 7", "Team 8", "Team 9",
                "Team 10", "Team 11", "Team 12", "Team 13", "Team 14", "Team 15", "Team 16", "Team 17", "Team 18"};
                public int getSize() { return headers.length; }
                public Object getElementAt(int index) { return headers[index]; }
              // add listModel & rownames to the table
              DefaultTableModel defaultModel = new DefaultTableModel(listModel.getSize(),3);
              JTable table = new JTable( defaultModel );
              // setting the columnnames and center alignment of table cells
              int width = 200;
              int[] vColIndex = {0,1,2};
              String[] ColumnName = {"Name Team", "Name Chairman", "Name Manager"};
              TableCellRenderer centerRenderer = new CenterRenderer();          
              for (int i=0; i < vColIndex.length;i++)          {
                             table.getColumnModel().getColumn(vColIndex).setHeaderValue(ColumnName[i]);
                             table.getColumnModel().getColumn(vColIndex[i]).setPreferredWidth(width);
                             table.getColumnModel().getColumn(vColIndex[i]).setCellRenderer(centerRenderer);
              table.setFont(new java.awt.Font("Dialog", Font.ITALIC, 12));
              // force the header to resize and repaint itself
              table.getTableHeader().resizeAndRepaint();
              // create single component to add to scrollpane (rowHeader is JList with argument listModel)
              JList rowHeader = new JList(listModel);
              rowHeader.setFixedCellWidth(100);
              rowHeader.setFixedCellHeight(table.getRowHeight());
              rowHeader.setCellRenderer(new RowHeaderRenderer(table));
              // add to scroll pane:
              JScrollPane scroll = new JScrollPane( table );
              scroll.setRowHeaderView(rowHeader); // Adds row-list left of the table
              getContentPane().add(scroll, BorderLayout.CENTER);
              // add menubar, menu, menuitems with evenlisteners to the frame.
              JMenuBar menubar = new JMenuBar();
              setJMenuBar (menubar);
              JMenu filemenu = new JMenu("File");
              menubar.add(filemenu);
              JMenuItem open = new JMenuItem("Open");
              JMenuItem save = new JMenuItem("Save");
              JMenuItem exit = new JMenuItem("Exit");
              open.addActionListener(this);
              save.addActionListener(this);
              exit.addActionListener(this);
              filemenu.add(open);
              filemenu.add(save);
              filemenu.add(exit);
              filemenu.addItemListener(this);
    // ActionListener for ActionEvents on JMenuItems.
    public void actionPerformed(ActionEvent e) {       
         String open = "Open";
         String save = "Save";
         String exit = "Exit";
              if (e.getSource() instanceof JMenuItem)     {
                   JMenuItem source = (JMenuItem)(e.getSource());
                   String x = source.getText();
                        if (x == open)          {
                             System.out.println("open file");
                        // create JFileChooser.
                        String filename = File.separator+"tmp";
                        JFileChooser fc = new JFileChooser(new File(filename));
                        // set default directory.
                        File wrkDir = new File("C:/Documents and Settings/Erwin en G-M/Mijn documenten/Erwin/Match Day");
                        fc.setCurrentDirectory(wrkDir);
                        // show open dialog.
                        int returnVal =     fc.showOpenDialog(null);
                        File selFile = fc.getSelectedFile();
                        if(returnVal == JFileChooser.APPROVE_OPTION) {
                        System.out.println("You chose to open this file: " +
                   fc.getSelectedFile().getName());
                        try          {
                             BufferedReader invoer = new BufferedReader(new FileReader(selFile));
                             String line = invoer.readLine();
                             System.out.println(line);
                             // THIS IS WHERE IT GOES WRONG, I THINK
                             table.setValueAt(line, 1, 1);
                             table.fireTableDataChanged();
                        catch (IOException ioExc){
                        if (x == save)          {
                             System.out.println("save file");
                        if (x == exit)          {
                             System.out.println("exit file");
    // ItemListener for ItemEvents on JMenu.
    public void itemStateChanged(ItemEvent e) {       
              String s = "Item event detected. Event source: " + e.getSource();
              System.out.println(s);
         public static void main(String[] args)                {
              TeamTable frame = new TeamTable();
              frame.setUndecorated(true);
         frame.getRootPane().setWindowDecorationStyle(JRootPane.FRAME);
              frame.addWindowListener( new WindowAdapter()           {
                   public void windowClosing( WindowEvent e )                {
         System.exit(0);
    frame.setVisible(true);
    * Define the look/content for a cell in the row header
    * In this instance uses the JTables header properties
    class RowHeaderRenderer extends JLabel implements ListCellRenderer           {
    * Constructor creates all cells the same
    * To change look for individual cells put code in
    * getListCellRendererComponent method
    RowHeaderRenderer(JTable table)      {
    JTableHeader header = table.getTableHeader();
    setOpaque(true);
    setBorder(UIManager.getBorder("TableHeader.cellBorder"));
    setHorizontalAlignment(CENTER);
    setForeground(header.getForeground());
    setBackground(header.getBackground());
    setFont(header.getFont());
    * Returns the JLabel after setting the text of the cell
         public Component getListCellRendererComponent( JList list,
    Object value, int index, boolean isSelected, boolean cellHasFocus)      {
    setText((value == null) ? "" : value.toString());
    return this;

  • Open and read from text file into a text box for Windows Store

    I wish to open and read from a text file into a text box in C# for the Windows Store using VS Express 2012 for Windows 8.
    Can anyone point me to sample code and tutorials specifically for Windows Store using C#.
    Is it possible to add a Text file in Windows Store. This option only seems to be available in Visual C#.
    Thanks
    Wendel

    This is a simple sample for Read/Load Text file from IsolateStorage and Read file from InstalledLocation (this folder only can be read)
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using System.Threading.Tasks;
    using Windows.Storage;
    using System.IO;
    namespace TextFileDemo
    public class TextFileHelper
    async public static Task<bool> SaveTextFileToIsolateStorageAsync(string filename, string data)
    byte[] fileBytes = System.Text.Encoding.UTF8.GetBytes(data);
    StorageFolder local = Windows.Storage.ApplicationData.Current.LocalFolder;
    var file = await local.CreateFileAsync(filename, CreationCollisionOption.ReplaceExisting);
    try
    using (var s = await file.OpenStreamForWriteAsync())
    s.Write(fileBytes, 0, fileBytes.Length);
    return true;
    catch
    return false;
    async public static Task<string> LoadTextFileFormIsolateStorageAsync(string filename)
    StorageFolder local = Windows.Storage.ApplicationData.Current.LocalFolder;
    string returnvalue = string.Empty;
    try
    var file = await local.OpenStreamForReadAsync(filename);
    using (StreamReader streamReader = new StreamReader(file))
    returnvalue = streamReader.ReadToEnd();
    catch (Exception ex)
    // do somthing when exception
    return returnvalue;
    async public static Task<string> LoadTextFileFormInstalledLocationAsync(string filename)
    StorageFolder local = Windows.ApplicationModel.Package.Current.InstalledLocation;
    string returnvalue = string.Empty;
    try
    var file = await local.OpenStreamForReadAsync(filename);
    using (StreamReader streamReader = new StreamReader(file))
    returnvalue = streamReader.ReadToEnd();
    catch (Exception ex)
    // do somthing when exception
    return returnvalue;
    show how to use it as below
    async private void Button_Click(object sender, RoutedEventArgs e)
    string txt =await TextFileHelper.LoadTextFileFormInstalledLocationAsync("TextFile1.txt");
    Debug.WriteLine(txt);
    在現實生活中,你和誰在一起的確很重要,甚至能改變你的成長軌跡,決定你的人生成敗。 和什麼樣的人在一起,就會有什麼樣的人生。 和勤奮的人在一起,你不會懶惰; 和積極的人在一起,你不會消沈; 與智者同行,你會不同凡響; 與高人為伍,你能登上巔峰。

  • How can I load a .TXT file into a dynamic text box?

    I am sure that many people know how to load a .txt file into
    a dynamic text box. But I do not. I want to be able to reference a
    txt file from the server into the text box. So that when I change
    the text file it changes in the flash movie without even editing
    the flash file itself. Thank you.

    http://www.oman3d.com/tutorials/flash/loading_external_text_bc/
    I think this is the simplest way to go :)

  • Also problem read txt files into JTable

    hello,
    i used the following method to load a .txt file into JTable
    try{
                        FileInputStream fin = new FileInputStream(filename);
                        InputStreamReader isr = new InputStreamReader(fin);
                        BufferedReader br =  new BufferedReader(isr);
                        StringTokenizer st1 = new StringTokenizer(br.readLine(), "|");
                        while( st1.hasMoreTokens() )
                             columnNames.addElement(st1.nextToken());
                        while ((aLine = br.readLine()) != null)
                             StringTokenizer st2 = new StringTokenizer(aLine, "|");
                             Vector row = new Vector();
                             while(st2.hasMoreTokens())
                                  row.addElement(st2.nextToken());
                             data.addElement( row );
                        br.close();
                        }catch(Exception e){ e.printStackTrace(); }
                   //colNum = st1.countTokens();
                   model = new DefaultTableModel(data,columnNames);
                   table.setModel(model);but there is a problem : if cell A's location is (4,5),and its left neighbour,that is, cell(4,4) is blank (the value is ""), the the cell A's value will be displayed in cell(4,4).if cell(4,3) is also blank ,the cell A's value will be displayed in cell(4,3).that is,the non-blank value will be displayed in the first blank cell of the line.
    how can i solve it?Please give me some helps or links.
    Thank u very much!

    Or, use the String.split(..) method to tokenize the data
    Or, use my SimpleTokenizer class which you can find by using the search function.

  • Interesting ? @ servlet reading a txt file

    hi friends,
    i need ur help for one interesting problem i m facing.
    I want to read a txt file and wanna display the text from that file into an html, using a servlet.A txt file contains sentences( words with spaces in between ).When servlet reads the file, it is reading the whole sentence ,but while displaying that sentence, it is just showing the first word of the sentence.
    html is not able to read the space between the words.
    so what do i suppose to do now.
    waiting for ur replies.......
    thanx
    amit

    hi friends ,
    i m giving the code , just give it a try//
    This is a servlet ---------------------------------------
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.io.*;
    import java.util.*;
    public class AdminGraphServlet extends HttpServlet
    Properties ht;
    FileInputStream fin;
    FileOutputStream fout;
    String s15,st;
    public void init(ServletConfig config) throws ServletException
    super.init(config);
    public void doGet(HttpServletRequest req, HttpServletResponse res) throws IOException,ServletException
    ht = new Properties();
    try
    fin = new FileInputStream("Data.txt");
    catch(FileNotFoundException e)
    System.out.println("FileNotFound");
    try
    if(fin != null)
    ht.load(fin);
    s15 = (String)ht.get("title");
    fin.close();
    catch(IOException e)
    System.out.println("Error Reading File");
    PrintWriter out = res.getWriter();
    res.setContentType("text/html");
    out.println("<html><body>");
    out.println("<form method=post action=http://localhost:8080/servlet/MyServlet>");
    out.println("<table><tr>");
    out.println("<tr><td>Title</td>");
    out.println("<td><Input Type=Text name=title value="+ s15 +"> </td></tr>");
    out.println("</table>");
    out.println("<input type=submit name=submit value=submit>");
    out.println("<input type=hidden name=check value=save>");
    out.println("</form>");
    out.println("</body></html>");
    public void doPost(HttpServletRequest req,HttpServletResponse res) throws ServletException,IOException
    String Scheck = req.getParameter("check");
    PrintWriter out1 = res.getWriter();
    String ttl = req.getParameter("title");
    if(Scheck.equals("save"))
    ht.put("title",ttl);
    fout = new FileOutputStream("Data.txt");
    ht.store(fout,"Data");
    fout.close();
    out1.println("<html><body>");
    out1.println("<h1>Stored This Data Successfully</h1>");
    out1.println("</html></body>");
    txt file is having a line
    title=Are you smart enough?
    The servlet should display this sentence in a text box.
    But it is displaying only "Are".
    still waiting...
    have nice time..
    amit

  • Convert .txt file into .xml file

    Hello,
    How do i convert an .txt file into an .xml file using labVIEW function?.
    Also i do i extract the header from the text file.
    My file format is mentioned in attached .txt file.
    Also I need to extract the header from the converted .xml file.
    Anticipating reply
    Attachments:
    Example.txt ‏1 KB

    There is no automatic mechanism for converting a .txt file to XML in any language. You have to define the XML schema and then write the code to generate the XML file. You could also read in your text file into some form of structure and then use the Flatten to XML functions to use the NI XML schema. If you need to use your own XML schema then you would need to use the XML Parser VIs to generate your XML file. Alternatively, you could use LabXML or JKI's EasyXML Toolkit.

  • Continiously read a txt file

    Hello fellows,
    is there a way to read a *.txt file continiously without doing the simple while loop wich burns all the CPU ??
    This txt file is generated by another application that pick up messages from a pipe and register messages in the txt file.
    As a final goal the messages read in the txt file will control other executions in the vi.
    Attached files: vi in LabVIEW 8.0 and the txt file.
    Attachments:
    Zip.zip ‏6 KB

    Thanks for your interest ! !
    The process will be as follows:
    1-an application reads text in a serveur pipe and write it into the txt file.
    2-The LabVIEW vi reads in loop the txt file and sort out the txt value each time that's updated by the application running in parralel.
    The goal is to synchronize the labview execution with the new messages arriving in the txt file.
    Thanks for your suggestions on how can I continiously read the txt file and take an action in the vi each time the txt file is updated with new text.
    See you...

  • Copy contents of a txt file into a transport request

    I am implementing the steps of the 990534 note.
    The note says "Create a new transport request (transaction SE09) in the source client of your Solution Manager system. Unpack file SOLMAN40_MOPZ_TTYP_SLMO_000.zip, which is attached to this note. Copy the contents of the SOLMAN40_MOPZ_TTYP_SLMO_000.txt file into the transport request."
    can anyone tell me how can I copy the contents of a txt file into a transport request?

    Hello,
    I don't know the OSS note, but I think they mean, that you have to go into the object list of your transport (in transaction SE09), switch to change mode and insert the objects from the text file.
    I guess the text file looks like:
    R3TR PROG xyz
    R3TR TABL abc
    Best regards
    Stephan

  • How to read/write .CSV file into CLOB column in a table of Oracle 10g

    I have a requirement which is nothing but a table has two column
    create table emp_data (empid number, report clob)
    Here REPORT column is CLOB data type which used to load the data from the .csv file.
    The requirement here is
    1) How to load data from .CSV file into CLOB column along with empid using DBMS_lob utility
    2) How to read report columns which should return all the columns present in the .CSV file (dynamically because every csv file may have different number of columns) along with the primariy key empid).
    eg: empid report_field1 report_field2
    1 x y
    Any help would be appreciated.

    If I understand you right, you want each row in your table to contain an emp_id and the complete text of a multi-record .csv file.
    It's not clear how you relate emp_id to the appropriate file to be read. Is the emp_id stored in the csv file?
    To read the file, you can use functions from [UTL_FILE|http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14258/u_file.htm#BABGGEDF] (as long as the file is in a directory accessible to the Oracle server):
    declare
        lt_report_clob CLOB;
        l_max_line_length integer := 1024;   -- set as high as the longest line in your file
        l_infile UTL_FILE.file_type;
        l_buffer varchar2(1024);
        l_emp_id report_table.emp_id%type := 123; -- not clear where emp_id comes from
        l_filename varchar2(200) := 'my_file_name.csv';   -- get this from somewhere
    begin
       -- open the file; we assume an Oracle directory has already been created
        l_infile := utl_file.fopen('CSV_DIRECTORY', l_filename, 'r', l_max_line_length);
        -- initialise the empty clob
        dbms_lob.createtemporary(lt_report_clob, TRUE, DBMS_LOB.session);
        loop
          begin
             utl_file.get_line(l_infile, l_buffer);
             dbms_lob.append(lt_report_clob, l_buffer);
          exception
             when no_data_found then
                 exit;
          end;
        end loop;
        insert into report_table (emp_id, report)
        values (l_emp_id, lt_report_clob);
        -- free the temporary lob
        dbms_lob.freetemporary(lt_report_clob);
       -- close the file
       UTL_FILE.fclose(l_infile);
    end;This simple line-by-line approach is easy to understand, and gives you an opportunity (if you want) to take each line in the file and transform it (for example, you could transform it into a nested table, or into XML). However it can be rather slow if there are many records in the csv file - the lob_append operation is not particularly efficient. I was able to improve the efficiency by caching the lines in a VARCHAR2 up to a maximum cache size, and only then appending to the LOB - see [three posts on my blog|http://preferisco.blogspot.com/search/label/lob].
    There is at least one other possibility:
    - you could use [DBMS_LOB.loadclobfromfile|http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14258/d_lob.htm#i998978]. I've not tried this before myself, but I think the procedure is described [here in the 9i docs|http://download.oracle.com/docs/cd/B10501_01/appdev.920/a96591/adl12bfl.htm#879711]. This is likely to be faster than UTL_FILE (because it is all happening in the underlying DBMS_LOB package, possibly in a native way).
    That's all for now. I haven't yet answered your question on how to report data back out of the CLOB. I would like to know how you associate employees with files; what happens if there is > 1 file per employee, etc.
    HTH
    Regards Nigel
    Edited by: nthomas on Mar 2, 2009 11:22 AM - don't forget to fclose the file...

  • Assistance in Reading a .txt file

    I'm newbie on Java and I have a problem
    I'm doing a homework on Systems and I need to read a .txt file [It would be on the same folder as the Java file].
    The catch is that I have to read by Lines, Each Line could have as much as 3 words[tokens] as little as one.
    I also have to read the characters on the words/tokens to identify if they are valid.
    I have thought of 2 ways of doing this.
    Reading ALL the line and dividing the words by the Spaces.
    Or read the words by tokens and then having a flag to know when the line jumps.
    Example of the text file:
    ORG %011010
    Et1 equ $ffFF
    ;Comentary # 1
    dos LDAA @456
    END
    I hope I'm being clear.
    Now, I'm not looking to have my homework done for me, but I am looking for some pointers.
    I've tried the Scanner class but I just don't know the right methods I guess... I've also heard the Token StringTokenizer class works. But I have no clue.
    Someone could give me pointers? which Class would be the right one and which methods?
    I've been Struggling with this all week.
    Help will be really appreciated.

    I would use the Scanner class to read an entire line. If you don't know what methods to use then read the Java API and the explanation for each method of the Scanner class. Write some code to experiment and see what those methods do. Then when you have an entire line I would use String.split as StringTokenizer is/has been deprecated.

  • 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.

  • How to convert a HTML files into a text file using Java

    Hi guys...!
    I was wondering if there is a way to convert a HTML file into a text file using java programing language. Likewise I would also like to know if there is a way to convert any type of file (excel, power point, and word) into text using java.
    By the way, I really appreciated the help that you guys gave me on my previous topic on how to extract tests from a pdf file.
    Thank you....

    HTML files are already text files. What do you mean you want to convert them?
    I think if you search the web, you can find things for converting those MS Office files to text (or extracting text from them, as I assume you mean).

Maybe you are looking for

  • Row position in alv report

    Hi experts.... I want to put data in first row in alv report. I am using reuse_alv_list_display for alv report output. I used "FIELDCAT_LN-ROW_POS = '1'. ' but it doesn't make any effect in output. please help me. thank you.

  • Applicability of Two Tax codes in one line item

    Dear Experts How can I set two tax codes (one is VAT & other is Service Tax) in one line item.

  • How to delete message from the fodler of  AOL account using Java mail

    Hello All, I am using Java MAil API in my application, i want to delete message from AOL account's folder, when i set the folder as "Recently Deleted" or "Trash" , i get an exception as "folder does not exist". when i tested , some times mail is movi

  • Fingerprint Reader Not Working

    So I had Avast! on my computer. It was annoying and scanned every file for like 30 seconds with DeepScan. So I uninstalled it. When it uninstalled, it removed my fingerprint reader driver. My computer got really slow and a lot of my apps don't work.

  • Export in Query ready mode - Office 2010 not working

    Hello everyone, I am facing the following problem with Hyperion Financial Reporting: When I display a Financial Reporting report in Workspace and click on "Export in query ready mode", a new Excel session is launched with an empty sheet and nothing e