Reading file into TYPE RECORD

I have TYPE RECORD defined as
TYPE IN_REC IS RECORD
(field1 varchar2,
field2 number,
field3 date);
i_rec IN_REC;
Can I read a text file directly into in_rec or i_rec using
utl_file.get_line(file_handler,in_rec) or
utl_file.get_line(file_handler,i_rec)
Please advise, basically I want to load the file into a data structure.
Thx

OK, I have to do some valiadations and append data to that text file and write it out so would still go via this route.
So if I declare
s varchar2(50);
and then
utl_file.get_line(f,s);
Can I extract the individual fields like this
inp_rec.field1 := substr(s,1,9);
Thx

Similar Messages

  • AppleScript error on Tiger only: "can't make file into type alias"

    Hi,
    I'm successfully using this smart TextWrangler applescript from this webpage for opening files on the same folder as the current document:
    http://blog.ampli.fi/textwrangler-open-file-from-directory-of-current-file/
    It works fine on Mountain Lion.
    However, when I try it on Tiger 10.4.11, this error dialog appears: "TextWrangler got an error: Can't make [file] into type alias".
    The script basically gets the path of the current document in TextWrangler and posts a file chooser on such path.
    I guess these are the lines that Tiger doesn't like:
      set current_path to POSIX path of current_file
      set new_file to choose file default location (current_path) with multiple selections allowed
    open new_file
    After googling for the error "can't make [] into type alias", I tried to change such lines to:
      set current_path to (POSIX path of (current_file as alias))
      set new_file to choose file default location (current_path) with multiple selections allowed
    open new_file
    But, however, the same error remains.
    Do you have any idea on how could this work?
    Thanks!

    wow, 10.4...
    try this:
    set current_path to current_file
    set new_file to choose file default location (current_path) with multiple selections allowed
    open new_file
    I'm not certain when the standard applescript dialogs were updated to accept posix paths, but it may have been 10.5.

  • Insert Insert XML file into multiple records in Oracle Database

    I would like to find out if it is possible to insert a single XML file into multiple records or tuples in a Oracle database table. I have a single XML file which is at multiple levels. The meta data for the levels are common and each level can have meta data of their own in addition. I do not have any meta data field which will uniquely determine whether the data belongs to Root level, Intermediate level or at the document level. Is there any way I can determine which level the meta data belongs to and thereby make a corresponding entry into the database table tuple? For example I could have an attribute called level which is going to be present only in the database table and not in the XML file. If level=1 then it corresponds to "Root" meta data, if level=2 then it corresponds to "Intermediate" level and if level=3 then it corresponds to meta data at document level. I need a way to calculate the value for level from the XML file and thereby insert the meta data element into a tuple in a single table in Oracle.

    Hi,
    extract your xml and then you can use insert all clause.
    here's very small example on 10.2.0.1.0
    SQL> create table table1(id number,val varchar2(10));
    Table created.
    SQL> create table table2(id number,val varchar2(10));
    Table created.
    SQL> insert all
      2  into table1 values(id,val)
      3  into table2 values(id2,val2)
      4  select extractValue(x.col,'/a/id1') id
      5        ,extractValue(x.col,'/a/value') val
      6        ,extractValue(x.col,'/a/value2') val2
      7        ,extractValue(x.col,'/a/id2') id2
      8  from (select xmltype('<a><id1>1</id1><value>a</value><id2>2</id2><value2>b</value2></a>') col from dual) x;
    2 rows created.
    SQL> select * from table1;
            ID VAL                                                                 
             1 a                                                                   
    SQL> select * from table2;
            ID VAL                                                                 
             2 b                                                                    Ants

  • Adobe reader file preview type library reference

    Where I will may see adobe reader file preview type library reference?

    I would guess that this interface is registered and used by Windows to generate previews for Explorer. It is not supported or documented, but if it does that, it won't have anything to do with text extraction.
    Adobe Reader has a supported interface for displaying in a window.
    For a text extraction API you'd want Acrobat, which would allow you via VBA to run JavaScript to get text quads.
    Note that this is not for server use. If you want server text extraction consider Adobe's PDF iFilter. This is unusual in that it is supported but is not in the SDK; Microsoft define the interfaces to iFilters, not Adobe.
    If you have further questions about Acrobat or Reader development, I'd recommend that you post in the Acrobat SDK forum, to reach the right experts.

  • Specifying byte stream type for Read File with Type Descriptor

    Hi.
    I'm trying to write a VI that reads an image file format that can have
    different datatypes. What I have so far is that I open the file, read
    the header, and get the width, height, number of frames, and datatype.
    I calculate number of pixels by nrows*ncols*nframes with no problem,
    but I'm not sure how to tell Read File the correct datatype to read
    the data into.
    I tried using a Case structure where I have a Read File in each case
    with the correct type constant as input for that case. The problem is
    that the tunnel graduates the datatype to the highest representation.
    I found in Application Note 154 the discussion about Type Descriptors.
    Is there a way to generate a Type Descriptor and output it from a C
    ase
    structure? I tried just returning the value (e.g. 0x0402 for a Word),
    but Read File will just see that the byte stream type is a uint32.
    Is there any other way to do this?
    Thanks for any help.

    I converted the code to LabVIEW 6.1 for you and attached it below.
    Don't worry about being a newbie. We all start there. Keep asking this type of question and you won't stay there long.
    As you are discovering, being strictly typed means that you must rewrite code even for a simple data type change, or convert everything to the same data type first. For image data, conversion can result in a lot of extra space being wasted. Use a modified version of the GLV_WaveformBuffer.vi to hold your data. Use the array functions, which operate inline, to add to and delete the data wires in the buffer. This allows you to save several different data types. You will need several different inputs and outputs to handle these data types. I ha
    ve also attached a similar file created for exactly the problem you have - storing arrays of different data types (data from NI-SCOPE devices, in this case - can be float, I8, I16, or I32).
    Routines that take any type work in one of two ways. LabVIEW primitives, such as plus and minus operators, work by figuring out the type and doing the right thing in the C code layer of the LabVIEW environment. Users of LabVIEW can't do this. Users can make polymorphic VIs. Polymorphic VIs are actually a single VI for every data type that are referenced by a "wrapper", the polymorphic VI. Users still need to write a different VI for every data type they need.
    Take home message - if you need to work with different data types, you will need to rewrite your code for every data type or convert your data to a common data type. Polymorphic VIs and case statements are your friend.
    Let me know if you need more help.
    This account is no longer active. Contact ShadesOfGray for current posts and information.
    Attachments:
    GigaLabVIEW61.zip ‏362 KB
    sfpScpChan_Waveform_Buffer.zip ‏74 KB

  • Reading files into an array

    so im new to this and having problems.
    we have to read a .txt file into an array so when a user types a word in a text box it will search the file and reutrn found if the word is there and not found it the word is not there. but it is not reading the text file here is the code so far
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import java.io.*;
    public class Checker
    // Declares Values in the array
         static String [] anArray = new String[1000];
         // declares variables needed in code later
         int i;
         String s;
         static int count = 0;
         static String b;
         static JTextArea j = new JTextArea();
         public void readFile() throws IOException{
         File inFile = new File("words.txt");
         FileReader fileReader = new FileReader(inFile);
    BufferedReader bufReader = new BufferedReader(fileReader);
    while (true){
    b = bufReader.readLine();
    anArray[count] = b;
    count++;
    if(b==null) throw new EOFException("Hello, end of file reached");
    j.append(b);
    j.append("\n");
         // public static void main(String args[]){
         // File outFile = new File("words.txt");
         //FileOutputStream outFileStream = new FileOutputStream(outFile);
         // PrintWriter outStream = new PrintWriter(outFileStream);
         // outStream.println("help");
    // File inFile = new File("words.txt");
    // FileReader fileReader = new FileReader(inFile);
    // BufferedReader bufReader = new BufferedReader(fileReader);
    /* while (true){
    b = bufReader.readLine();
    anArray[count] = b;
    count++;
    if(b==null) throw new EOFException("Hello, end of file reached");
    j.append(b);
    j.append("\n");
    public String checkword(String Word ) {
    // Tries the code, runs through until an exception is found.
    try {
    for ( i = 0; i < anArray.length; i++)
    if (Word.equals(anArray))
    // If exception is found, throws a new exception
    if (Word.equals(anArray[i])) throw new Exception(); // end if
    } // end if
    } // end for
    } // end try
    catch (Exception ae ) {
    // if the word is found return a message found and its position in array.
    return "Found, at position "+i;
    }// end catch
    // if its not in the array return a not found message
    return "Not found";
         } // end
    } // end
    and the gui class :
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import java.io.*;
    public class CountDown extends JFrame implements ActionListener
    // Defines the GUI components
    private JTextField Word = new JTextField(9);
    private JButton Guess = new JButton("Enter String");
         private JLabel Message = new JLabel("not found");
         // Creates a new instance of the Checker class.
    Checker ch = new Checker();
    public CountDown() // constructor
    setTitle("Count Down");
    setSize(300,200);
    setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    setVisible(true);
    Container c = getContentPane();
    c.setBackground(Color.white);
    c.setLayout(new GridLayout(3,1));
    // Add the components
    c.add(Word);
    c.add(Guess);
    c.add(Message);
    c.add(ch.j);
    // Add action Listener for Button to work
    Guess.addActionListener(this);
    pack();
    setContentPane(c);
    public void actionPerformed(ActionEvent e) {
    // When the button is pressed do this code
    if(e.getSource() == Guess)
    // Looks in the checker class to compare the word user enters, to the words in the array.
    // Returns a message if the word exists with its position in the list or
    // Returns a message if the word does not exisit.
    Message.setText( ch.checkword(Word.getText()));
    public class CountDownA
    public void main(String[] args)
    CountDown Game = new CountDown();
    any help is appriciated asap

    Yuck! I echo jverd's sentiment. Please only post the specific pieces of code that you are having trouble with, and use the forum 'code' tags.
    But to answer your question, I don't see where you're calling the readFile() method from. If you're not calling readFile, that might explain why nothing is being read.
    As for the design of the readFile method, another 'yuck'. heh Don't use exceptions to break out of a loop. If you MUST break out of a loop, use break. But a loop like this doesn't need break. Try something like this:while( (b = bufReader.readLine()) != null)
         anArray[count++] = b;
         j.append(b+"\n");
    }Also, in stead of creating an array of some arbitrary fixed length, I recommend using a collection class such as ArrayList.
    In stead of this:static String [] anArray = new String[1000];
    anArray[count++] = b;it would be better to use something like this:static ArrayList<String> arrayList = new ArrayList<String>();
    arrayList.add(b);

  • Read file into multi-dimensional array - ideal world...

    Hello all, would be very grateful if you could help me...
    I have a file which has a format...
    string1a,string1b
    string2a,string2bi need to read this file, which will have a variable length, into a two dimensional array.
    the code below is just demonstrating my approach...
              List lines = new ArrayList();
              BufferedReader in = new BufferedReader(new FileReader(filename));
              String str;
              while ((str = in.readLine()) != null) {
                   lines.add(str.split(","));
              in.close();but when i later try and invoke the toArray() method of lines it complains about unsafe or unchecked operations.
    does any have any pointers about the best way to read a file into a multi-dimensional array? is it best practice to use the interface List?
    thanks in advance
    poncenby

    This is just a List of Lists - no worries there.
    Sounds like your toArray code is incorrect. Post that.
    %

  • Read file into a table

    Is there a way of reading content of a file into a table? what if that file is overwritten each x minutes for update?

    yes sure.
    JSplitPane's can hold two components - so your table can be one of the components, and some other feature e.g. a JPanel (which is containing other components in turn) is the other component.
    e.g.
    JSplitPane mainSplitPane_LeftRight = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT); // or JSplitPane.VERTICAL_SPLIT
    mainSplitPane_LeftRight.setOneTouchExpandable(true); // set whether you want to be able to maximize one of the components in the JSplitPane using a button on the divider
    // component 1 of splitpane
    JTable yourTable = new JTable(); // initialise with your code here
    // component 2 of splitpane
    JTree tree = new JTree(); // example component
    yourTable.setMinimumSize(new Dimension(10, 10)); // this ensures we can always move the dividers
    tree.setMinimumSize(new Dimension(10, 10)); // this ensures we can always move the dividers
    // add the components
    mainSplitPane_LeftRight.setLeftComponent(yourTable);
    mainSplitPane_LeftRight.setRightComponent(tree);
    // then now we have a populated JSplitPane which you may wanna shove into a JFrame??
    JFrame frame = new JFrame("Tester");
    frame.getContentPane().add(mainSplitPane_LeftRight);
    frame.pack();
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    frame.show(); // show it.Hope that helped.

  • Reading file into itab

    I have to read a text file into my data objects until the end of file. I need help with this syntax
    do
    read dataset file into strfile
    while end of file ?

    Hi Megan,
    Hope this code helps you.
    Start-of-selection.                         
      open dataset fname for input in text mode.                    
      if sy-subrc <> 0.                                             
        message s999(z1) with 'File not found or cannot be opened'. 
        stop.                                                       
      endif.                                                        
      do.                                                           
        read dataset fname into i_upload.                           
        if sy-subrc <> 0.                                           
          exit.                                                     
        endif.                                                      
        append i_upload.                                            
        clear  i_upload.                                            
      enddo.                                                        
      close dataset fname.                                          
    Thanks,
    Srinivas

  • Reading file into SAP from foreground with record length 255

    I am trying to read a text file using GUI_UPLOAD. But, some of the records are more than 255 characters in length. When I try to load them to an internal table, the rest of the characters are getting truncated. Is there any possibility of uploading all the remaining characters also? The maximum length of a record might be 400 characters.

    Hi
    try to define the field of your internal as char longer than 255 char, if u want to make sure u can use the type string:
    TYPES TY_LINE TYPE STRING.
    DATA W_LINE TYPE TY_LINE.
    DATA T_FILE TYPE TABLE OF TY_LINE.
    Max

  • Help reading file into array

    Hi, could any one give me some tips on how to fill this array from a file (data.txt) on the computer that reads:
    50 99 44 35 37 22 12 19 7 44
    77 64 23 52 59 62 85 98 5 100
    72 70 60 50 43 30 20 10 91 1
    11 31 81 98 61 13 21 25 44 10
    The values are 1-100 but the program's array should have 10 spots. This is what I have so far but I'm confused about what I'm doing:
    public static void main(String[] args)
    EasyReader console = new EasyReader();
         final int MAX = 100;
         int [] values = new int [MAX];
         int [] numberValues = new int [10];
         // EasyReader File23 = new EasyReader("D:\\data.txt");
         // String value= File23.readLine();
         //System.out.print(value);
         int logicalLength;
         logicalLength = fillArray(numberValues);
         System.out.print(logicalLength);
         public static int fillArray(int []numberValues)      
         EasyReader File23 = new EasyReader("D:\\data.txt");
              int LL = 0;
              int xy= File23.readInt();
              while (!File23.eof())
                   numberValues[LL] = xy;
                   LL++;
                   xy = File23.readInt();
                   File23.close();
                   return LL;
         }     

    thanks for the tip:
    Any tips on how to fill this array from a file (data.txt) on the computer that reads:
    50 99 44 35 37 22 12 19 7 44
    77 64 23 52 59 62 85 98 5 100
    72 70 60 50 43 30 20 10 91 1
    11 31 81 98 61 13 21 25 44 10
    The values are 1-100 but the program's array should have 10 spots. This is what I have so far but I'm confused about what I'm doing (there is an exception in the main too):
    public static void main(String[] args)
    EasyReader console = new EasyReader();
    final int MAX = 100;
    int [] values = new int [MAX];
    int [] numberValues = new int [10];
    int logicalLength;
    logicalLength = fillArray(numberValues);
    System.out.print(logicalLength);
    public static int fillArray(int []numberValues)
    EasyReader File23 = new EasyReader("D:\\data.txt");
    int LL = 0;
    int xy= File23.readInt();
    while (!File23.eof())
    numberValues[LL] = xy;
    LL++;
    xy = File23.readInt();
    File23.close();
    return LL;
    }

  • Unable to Read XML files into PI 7.0

    Dear Friends,
    I am working on File to IDOC and IDoc to File scenario with a shared folder concept.
    we have tested all our transactions to and fro with out any problem. Two days back we faced sudden server shut down due to power issue.
    From that day we are facing problem in reading files into XI
    We are not facing any problem during outbound transactions from SAP  on the same business system, where inbound folder path is also mentioned.
    I have checked in Monitoring under communication channel..
    it is showing comm channal is correctly configured...
    is there any way i can check where it is going wrong..
    Any thoughts and suggestions is highly rewarded.
    Thanks & Regards,
    Suman

    Hi Santhosh,
    We have given full folder permissions for all users. Processed read file option  is not enabled in my Sender CC.
    Thanks for quick response.
    Regards,
    Suman

  • How can I transfer an adobe reader file to Microsoft word?

    I have Windows Vista on my machine. I really need to transfer an Adobe reader file into Microsoft word or at least be able to type inside of Adobe. Just wondering how can I do this task or am I just not able to?
    Any help or suggestions out there..?

    That would require using Adobe Acrobat. It can create Word docs from PDF's.
    The bad news is, most of the time it doesn't do a very good job at it.
    With Acrobat, you could also add form fields that you can fill in which would be much better.

  • Problem loading .orf files into photoshop

    I have CC on both an iMac and a MacBook Pro
    .orf files will load into photoshop on the iMac but not on the MacBook Pro.  A popup appears which states need to update for latest RAW files.  I have run and installed the latest update but without success.  Since updating I've tried switching off and back on but with no success.
    What do I do next?

    Thanks partial success
    ACR was 8.3.  I've uploaded version 8.6 using the link provided and now able to read files into photoshop but
    1. Mini bridge does not show thumbnails only a place holder with no image
    2. The version on the iMac is 8.4 which I will also update but on both computers clicking on product update on Apple menu did not show the latest ACR update.  How can I arrange for auto updates without continually checking using the above link whether an update is available.

  • How to see changes in my ini-file of Types palette

    I added new .ini file into Types palette. When I am exiting from Teststand it asks me to save modified ini-files. How can I see what changes are made to this ini file? Now I see only *mark before my ini-file in Types palette but can't see what are the changes.
    BR,
    Jick

    Jick wrote:
    If I add my own ini-file to Types palette *mark appears after the name. When I close TS it asks me to save it althougt I have not done any changes. Why?
    BR,
    Jick
    It's either because of type conflict resolution (i.e. newer versions of types are already in memory that are contained in your file), or it could be because your file is from an earlier version of teststand and thus required conversions in order to bring it up to date. There is a setting in newer versions of teststand to customize the "marking as modified" behavior. In the Station Options->File tab, there is a setting, "Do Not Mark Files as Modified if Modification is Caused Only by Automatic TestStand Version Upgrade", which you might be interested in using.
    Hope this helps,
    -Doug

Maybe you are looking for

  • Photoshop CS6 Redraw Glitch [Early 2011 13-inch model]

    I have Photoshop CS6 and for the first week it worked fine. Then, I was working at 50% zoom and at first, when I went to 100% zoom, it deleted random parts of different layers and even when I zoomed back out they were still missing. It just showed th

  • Why does CC need my login every time I launch a CC program?

    On my Windows 7 64 bit system with some CS6 and CC programs and running from an administrator account with UAC set at "never notify" I'm being asked for my login just about every time I launch any CC program. This is has been slowly getting. This is

  • Common Header in each page in WP8

    Hi, I am creating a Windows Phone application.I have a common header that I have to display in each page.Is there a way to create a common UI that could be included in every xaml page.If yes, then how can I do it?

  • Unable to map/get Attributes with import of LDIF Object Class

    Hi All, We are trying to take import of Customized Object Class and Attributes into OID through LDIF. LDIF import command is: ./ldapadd -p 3060 -h myhost -D "cn=orcladmin" -w Ac123456 -f xyzObjClass.ldif LDIF contents are: dn: cn=subSchemaSubentry ch

  • 800MB RAM Usage with nothing running?

    I am pretty confused, my MacBook seems to be using a lot of memory with nothing significant running. I've cleaned all caches, and ran all the maintenance scripts, but from shutdown to restart, with nothing running (not even dashboard), it shows over