Read ONLY a line in file

Hello expert,
I have a file which have lots of records, i want to read the first line only. how can i do this. I've tried GUI_UPLOAD. it retrieve all the file data but i dont want this, i want it to retrieve ONLY the first record.
Any solution experts.

Hi Hassim,
you can delete other records once read fom file as below, you will remain with first record.
DESCRIBE TABLE t_record LINES l_line.
DELETE t_record FROM 2 TO l_line.
Or
Use FM 'ALSM_EXCEL_TO_INTERNAL_TABLE' mention as below.
Let us take if you have 4 colums and many rows and u want to read all 4 columns of first row, read like below.
CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
  EXPORTING
    filename                = l_file
    i_begin_col             = 1
    i_begin_row             = 1
    i_end_col               = 4
    i_end_row               = 1
  TABLES
    intern                  = t_record[]

Similar Messages

  • Programming help - how to get the read-only state of PDF file is windows explorer preview is ON?

    Programming help - how to get the read-only state of PDF file is windows explorer preview is ON?
    I'm developing an application where a file is need to be saved as pdf. But, if there is already a pdf file with same name in the specified directory, I wish to overwrite it. And in the overwrite case, read-only files should not be overwritten. If the duplicate(old) file is opened in windows (Win7) explorer preview, it is write protected. So, it should not be overwritten. I tried to get the '
    FILE_ATTRIBUTE_READONLY' using MS API 'GetFileAttributes', but it didn't succeed. How Adobe marks the file as read-only for preview? Do I need to check some other attribute of the file?
    Thanks!

    Divya - I have done it in the past following these documents. Please read it and try it it will work.
    Please read it in the following order since both are a continuation documents for the same purpose (it also contains how to change colors of row dynamically but I didnt do that part I just did the read_only part as your requirement) 
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/f0625002-596c-2b10-46af-91cb31b71393
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/d0155eb5-b6ce-2b10-3195-d9704982d69b?quicklink=index&overridelayout=true
    thanks!
    Jason PV

  • "read from measurement file" reads only first line of data

    Hello,
    I have a problem when trying to read a .lvm file through "Read from Measurements file" with the following block diagram
    Problem: it reads only the first line of data from what I can see in the probe window,.
    A part of the lvm file for reference.
    I haven't used Labview in a long long time, I'm trying to figure out what I am doing wrong.
    Thanks

    Sorry meant to attach the lvm. Here it is. (Actually I had to put it in .txt because the forum wont let me upload a lvm file)
    I unfortunately cannot share the full vi that record the data as I am not its owner/creator. I'll try to give as much info as I can with the relevant pictures attached, I hope it allows us to at least have an hint of where the problem might be.
    (this is in a while loop)
    In the stacked sequence, the other pannels are similar to the one shown here: value read fron a variable, converted to dynamic and a signal attribute is set. The "start recording" control operation is "switch when pressed".
    Here are the properties of the set signal attributes
    And here are the properties of the "write to measurement file"
    Attachments:
    NoTarget_full circle__Rx_-10-SAMPLE.txt ‏60 KB

  • CRIO startup directory was typed STARTUP and now will not boot. How do I recover from this error or how do I rename the directory when my proxy server is read only due no startup files?

    I loaded files on the cRIO but used upper case letters for the startup directory.  Now I cannot access the RIO since it didn't boot. The proxy server comes up read-only so I can't reload the files or change the directory.  I tried the RS232 port but I can't get it to respond to commands even though I can see the processor boot.

    lockmas wrote:
    I loaded files on the cRIO but used upper case letters for the startup directory.  Now I cannot access the RIO since it didn't boot. The proxy server comes up read-only so I can't reload the files or change the directory.  I tried the RS232 port but I can't get it to respond to commands even though I can see the processor boot.
    There is NO need to put your entire question into the subject line of your post.
    cRIO will not boot is a suitable subject line

  • Read only account line item appears writable in the webform

    Hi All,
    We are using Hyperion Planning 11.1.1.2.We have a line item called "Salary" under account which is set to read only.Its parent "Compensation" has the security set as IDesc(writable).
    The line item Salary is used in 2 forms.In one form it appears as readonly and in the other it appears as writable.Both the forms are identical except for the change in member in custom dimension for which security is not applied.
    Ideally this line item has to appear as readonly.
    Can anybody throw some light on this issue?
    Thanks in advance,
    Malini

    Hi,
    Can you just try this,edit the first form that works, do a save as and give it a name, change the custom dimension member. save. run. Is it the same?
    Cheers
    John
    http://john-goodwin.blogspot.com/

  • Read only filesystem when editing files

    I just installed installed arch linux and when i try to edit and save a config file   it says something like, "can't save file: read only filesystem". How do I change that?

    Ok, I think I know what the problem is now, / is not in /etc/fstab. The new question is, how do i get it there w/o reinstalling everything?

  • How can users who have Acrobat Reader only save scanned pdf files so that the text on them is searchable using ctrl-F?  I just use the recognize text with ocr feature in the full version of Acrobat and this seem to do the trick. Reader doesn't work!

    Our users have scanned pdf files they want to be able to search using ctrl-f.  I got them to be searchable by doing a recognize text using ocr with Acrobat Professional vesion 8.  They want to know if they can make the files searchable with Acrobat Reader only or if they need the full Acrobat Professional software to make the files searchable.
    Thanks for the help!!
    Ken K. - 2191

    To clarify a bit they need to have Adobe Acrobat, not Adobe Reader. Reader has not been associated with the Acrobat name for 3 or more versions. The process you are asking about is a creation process - the purpose of Acrobat - and NOT a reading feature.

  • 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);

  • Cannot retrieve all vector objects - reading only last line .. Please help

    <pre>
    When I test the vector in the method that adds the elements, each line is returned. Testing the vector in the method getData(), all items are returned within the while loop, but the test returns only the last line of in the vector. Can anyone help me out and let me know what I'm doing wrong.
    Here's a summary of what I'm doing and the code follows.....
    My bean class:
    - creates a vector and adds several lines to the vector
    - using StringTokenizer and Enumeration, parses the data and checks to see if the line has the required amount of tokens (which is 4). If so, then the string is passed to my main class
    In the main class, the string is parsed into its appropriate attribute and then the required ones are displayed in the browser.
    //Vector class bean
    public SpecBean()
    public Vector addData()
    vecdata.addElement ("3|4||");
    vecdata.addElement ("2|3||1200");
    vecdata.addElement ("1|2|Q|");
    vecdata.addElement ("4|2|U|4356");
    return vecdata;
    public String getData()
    StringTokenizer st;
    String record = new String();
    Enumeration enumdata = vecdata.elements();
    while (enumdata.hasMoreElements())
    record = enumdata.nextElement().toString();
    System.out.println (record);
    st = new StringTokenizer( record, "|");
    int numberOfTokens = st.countTokens();
    if (numberOfTokens < 4)
    record = "Incomplete Data";
    return record;
    // end class...
    //begin main class -- this is a servlet which is why the
    //out.println statements are there
    try {
    SpecBean specs = new SpecBean();
    specs.getItemListing();
    token = new StringTokenizer ((String)specs.getData(), "|");
    out.println ("<table width=\"100%\" border=1>");
    out.println("<tr>");
    out.println ("<td width=\"40%\">");
    while (token.hasMoreTokens())
    String id = token.nextToken();
    String orderNum = token.nextToken();
    String name = token.nextToken();
    String confNum = token.nextToken();
    out.println (title + "</td>");
    out.println ("<td width=\"20%\" align=\"right\">" + "$" + price + "</td>");
    out.println ("<td width=\"40%\">" + notes);
    //end main class
    Thank you.

    <pre>
    My apologies. What I was looking to do was return EVERY line from the vector that had an equivalent of 4 tokens and no less. I just realized that the sample data I had entered into the vector only had one line w/ 4 tokens. When this is modified and there are 2+ lines that contain 4 tokens, the only line that is retrieved is the very last line. So if the data in the vector was:
    public Vector addData()
    vecdata.addElement ("3|4|rtd|222");
    vecdata.addElement ("2|3||1200");
    vecdata.addElement ("1|2|QsT|");
    vecdata.addElement ("4|2|U|4356");
    return vecdata;
    public String getData()
    StringTokenizer st;
    String record = new String();
    Enumeration enumdata = vecdata.elements();
    while (enumdata.hasMoreElements())
    record = enumdata.nextElement().toString();
    System.out.println (record);
    st = new StringTokenizer( record, "|");
    int numberOfTokens = st.countTokens();
    if (numberOfTokens < 4)
    record = "Incomplete Data";
    return record;
    The output to the browser is
    4 2 U 4356
    and not
    3 4 rtd 222
    4 2 U 4356
    I did some print statements throughout addData() and getData() to see if all of the objects in the vector were still there and everything checked out until I hit the end of the getData(). Before 'return record' the print statement returned '4 2 U 4356' only. I'm not sure what I have missed to have the getData() method return only one matching line and not all of them.
    Your help is appreciated. Thank you.

  • My windows(8.1 64bit) partition is read only from the mac(yosemite) side of things. Anybody have a clue on how to fix this? Also, slightly frustrating as well, windows crashes every time I attempt to open a file from the mac partition.

    my windows(8.1 64bit) partition is read only from the mac(yosemite) side of things. Anybody have a clue on how to fix this? Also, slightly frustrating as well, windows crashes every time I attempt to open a file from the mac partition.

    All Office applications will also try to open a temporary work file in the same location as the source file. This implies the source file directory also needs to be writable for this temporary file. Since the default HFS+ driver provides only read-only access, such temporary files will fail to open, and will cause the application to fail.
    As a test copy the file you want to edit, say an Excel spreadsheet from the OSX file system to the C: drive on the Windows side and try to open it. If you look in this directory, you should see two files, the source and a temporary file. You may have to force the temporary file to be opened on a read-write file system, by manipulating the folder for temporary files.

  • When trying to save a file under Excel 2008, ver 12.3.3, with extension .xlsx or .xlx, I am told it can't be saved because it is "read only." How do I change the file from read only?

    When I try to save a file using Excel 2008, ver 12.3.3, with extension either .xlsx or .xls, I get a message saying it cannot be saved because it is "read only." How do I change it from read only? (And how did it ever get to be read only?)

    Save the file as a new name. Close and Open the new file.
    Most likely when a file transfer happens, Office makes the file 'Read Only'.
    If you have two opened files with the same name, the last opened file will be 'Read Only'.

  • File - read only

    I create new file using only "Write Characters To File".
    (I don't want user to see dialog to choose file name,etc.)
    I create .CSV file, and I want to set file as read only for any
    other applications except LabView. When MS Excel opens this file
    LabView is unable to write data to it.
    Is it any simple way to solve this ? Or di I must use .vi's that show dialog
    to chose file and dir.
    -jcz-

    When a file has been marked as "read only", then Excel open it in read only mode, and the file remains accessible to other applications. What you have to do is to switch the "Acces Rights"(in the advanced file function subpalette) between $80 and $100, to respectively unlock and lock the file, at each write operation in LabVIEW.
    Chilly Charly    (aka CC)
             E-List Master - Kudos glutton - Press the yellow button on the left...        

  • New user- all my files are now read only -

    I am using a Dell Inspiron 8600 laptop with Windows XP  and my husband has a Dell Dimesion 4600 desktop.  Two weeks ago I installed a Linksys Compact Wireless-G USB adapter on his computer and then installed a WRT54G v.6 wireless router.  All is working fine for internet connection. Today I discovered all my files are now read only and even when I uncheck the read only box and click apply, then close the file, on re-opening it it is again read only.  Even the files on my external hard drive are now read only. 
    I am backtracking to see where a change was made that was unintended and the wireless router was the last thing I installed.  Is there a connection?  And if so, can someone help me make the necessary changes or tell me where to find out?
    I read through a lot of messages but did not immediately see this situation addressed. 
    Sandra

    seems to be an OS issue , because there is nothing on the router setting that could change the configuration on the computer....try System Restore....can't think of anything else at this point...

  • My shared files are all set as read only. How do I sort this out?

    I am trying to set up our iMac and MacBook so that they share files.
    In System Preferences/Sharing I have set the File sharing to ON, I have selected which folders are to be shared and I have set it so that everyone can read and write the files.
    In the iMac files when you check various properties NONE are set as read only, however, when the files are access from the MacBook they are all READ ONLY.
    What am I doing wrong and how do I sort this out so that I can access files from either computer and amend and save them without having to change file names?
    Please help!!
    Karl

    I have had similar problems and have given up trying to use the "everyone" user setting.  Instead, to give shared access to a folder I add specific users and then set their access level.  To add users to a folders sharing profile click on the [+] button at the bottom of the Users column.

  • Unable to Open Mail "index is read only

    I am unable to open my mail and receive the following message. Mail can’t open because its index is read-only. The index file is located in /MacBook Pro HR/Users/tommygorse/Library/Mail/Envelope Index.  If this file is on your computer, use the Get Info window in the Finder to change your permissions for this file to “Read & Write.”  I have tied this and I still get the same message.  I also tried permission repair and received the following message: Warning: SUID file “System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/MacOS/ARDAg ent” has been modified and will not be repaired. Please advise.  Thank you.

    For whatever reason, I decided to trash the Envelope Index in the Mail Library.  I don"t know why I did this but it worked.   Thank goodness.
    Tommy

Maybe you are looking for

  • Error ORA-01403: no data found

    Hi, I'm working in a form application, i fill some text boxes when i press create i'm getting this error. I don't know what i maybe chage since before works fine. Thanks in advance. Edited by: user11334290 on Jul 13, 2009 1:06 PM

  • Zen v plus shows "docked" sta

    Dear All, I bought a Zen V plus mp3 player recently. I installed the s/w that came on the cd and loaded songs onto my mp3 player. Later, i wanted to remove some songs from the player and connected it to my computer. Any creative s/w that i used becam

  • Invalid objects after running catalog.sql and catproc.sql

    I have a db 10.1.0.3.0. standard edition with the 10.1.0.4.0 patch installed. After executing catalog.sql and catproc.sql the database contains lots of invalid objects in the public, olapsys and xdb schemas. I have executed utlrp.sql, the script comp

  • Error in Client Copy--Work process restarted

    when i am doing a Client copy of the SAP_CUST profile i am getting the following error. <b>"work process restarted"</b> Pls help

  • What do these errors mean ? Web Logic

    I am attempting to start Web Logic Server, and Web Logic Server for my application installed on my machine. I get the following errors, completely new to web Logic so I don't know what they mean. But it seems to be a privelege issue related to the ad