How to know a line of text file is ending with line feed or return?

hi all, i have a program that read log file that generated by other service (apache http server for example), i want to know that each line is ending with "\r", "\n" or "\r\n" so i can skip them in the next time, like this:
int char_counter=0;
BufferedReader reader = new BufferedReader(new FileReader(logFileName));
while((line=reader.readLine())!=null){
       char_counter+=line.length()+x_value;
}and the next time read the log file, i will skip all the lines that read in previous time.
BufferedReader reader = new BufferedReader(new FileReader(logFileName));
reader.skip(char_counter);
while((line=reader.readLine())!=null){
       char_counter+=line.length()+x_value;
}with x_value is 1 or 2 depended on line end with "\n" or "\r\n".
so, how to know which is the char line ending with?
Edited by: secmask on Feb 21, 2009 5:46 AM

Alright, the BufferedReader method readLine() reads all text until it finds a \n character. And then next time you call it it will automatically continue from where it left out.
try this out it should show it as an example
import java.io.*;
public class readLineTest {
    static FileOutputStream filename;
    static BufferedReader input;
    public static void main(String[] args)
        try
            filename = new FileOutputStream("logFile.txt", false);
        catch (IOException e)
            //blank
        PrintStream output = new PrintStream(filename);
        output.println("this is the first line");
        output.println("this is the second line");
        output.println("this is the third line");
        try
            input = new BufferedReader(new FileReader("logFile.txt"));
        catch(IOException e)
            //blank
        for(int i = 0; i < 3; i++)
            try
                System.out.println(input.readLine());
            catch(IOException e)
                //blank
}

Similar Messages

  • I was given an assingment, but have no idea where to begin. The assingment is to create a text file using notepad with all of my digital inputs and some how make those imputs show up on my digital indicators on my control pannel

    I was given an assingment, but have no idea where to begin. The assingment is to create a text file using notepad with all of my digital inputs and some how make those imputs show up on my digital indicators on my control pannel.
    When it was explained to me it didn't sound to hard of a task, I have no LabVIEW experience and the tutortial sucks.

    StevenD: FYI, I did NOT give you the one star rating. I would never do that!
    StevenD wrote:
    Ow. Someone is grumpy today.
    Well, this is an assignment, so it is probably homework.
    Why else would anyone give HIM such an assigment, after all he has no LabVIEW experience and the tutorials are too hard for him?
    This would make no sense unless all of it was just covered in class!
    This is not a free homework service with instant gratification.
    OK! Let's do it step by step. I assume you already have a VI with the digital indicators.
    "...but have no idea where to begin".
    open notepad.
    decide on a format, possibly one line per indicator.
    type the document.
    close notepad.
    open LabVIEW.
    Open the existing VI with all the indicators.
    (are you still following?)
    look at the diagram.
    Who made the program?
    Does the code make sense so far?
    Is it a statemachine or just a bunch of crisscrossed wires?
    Where do you want to add the file read?
    How should the file be read (after pressing a read button, at the start of the program ,etc.)
    See how far you get!
    Message Edited by altenbach on 06-24-2008 11:23 AM
    LabVIEW Champion . Do more with less code and in less time .

  • How to get the content of text file to write in JTextArea?

    Hello,
    I have text area and File chooser..
    i wanna the content of choosed file to be written into text area..
    I have this code:
    import java.awt.Container;
    import java.awt.FlowLayout;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import java.io.File;
    import javax.swing.JButton;
    import javax.swing.JFileChooser;
    import javax.swing.JFrame;
    import javax.swing.JLabel;
    import javax.swing.*;
    public class Test_Stemmer extends JFrame {
    public Test_Stemmer() {
    super("Arabic Stemmer..");
    setSize(350, 470);
    setDefaultCloseOperation(EXIT_ON_CLOSE);
    setResizable(false);
    Container c = getContentPane();
    c.setLayout(new FlowLayout());
    JButton openButton = new JButton("Open");
    JButton saveButton = new JButton("Save");
    JButton dirButton = new JButton("Pick Dir");
    JTextArea ta=new JTextArea("File will be written here", 10, 25);
    JTextArea ta2=new JTextArea("Stemmed File will be written here", 10, 25);
    final JLabel statusbar =
                  new JLabel("Output of your selection will go here");
    // Create a file chooser that opens up as an Open dialog
    openButton.addActionListener(new ActionListener() {
       public void actionPerformed(ActionEvent ae) {
         JFileChooser chooser = new JFileChooser();
         chooser.setMultiSelectionEnabled(true);
         int option = chooser.showOpenDialog(Test_Stemmer.this);
         if (option == JFileChooser.APPROVE_OPTION) {
           File[] sf = chooser.getSelectedFiles();
           String filelist = "nothing";
           if (sf.length > 0) filelist = sf[0].getName();
           for (int i = 1; i < sf.length; i++) {
             filelist += ", " + sf.getName();
    statusbar.setText("You chose " + filelist);
    else {
    statusbar.setText("You canceled.");
    // Create a file chooser that opens up as a Save dialog
    saveButton.addActionListener(new ActionListener() {
    public void actionPerformed(ActionEvent ae) {
    JFileChooser chooser = new JFileChooser();
    int option = chooser.showSaveDialog(Test_Stemmer.this);
    if (option == JFileChooser.APPROVE_OPTION) {
    statusbar.setText("You saved " + ((chooser.getSelectedFile()!=null)?
    chooser.getSelectedFile().getName():"nothing"));
    else {
    statusbar.setText("You canceled.");
    // Create a file chooser that allows you to pick a directory
    // rather than a file
    dirButton.addActionListener(new ActionListener() {
    public void actionPerformed(ActionEvent ae) {
    JFileChooser chooser = new JFileChooser();
    chooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
    int option = chooser.showOpenDialog(Test_Stemmer.this);
    if (option == JFileChooser.APPROVE_OPTION) {
    statusbar.setText("You opened " + ((chooser.getSelectedFile()!=null)?
    chooser.getSelectedFile().getName():"nothing"));
    else {
    statusbar.setText("You canceled.");
    c.add(openButton);
    c.add(saveButton);
    c.add(dirButton);
    c.add(statusbar);
    c.add(ta);
    c.add(ta2);
    public static void main(String args[]) {
    Test_Stemmer sfc = new Test_Stemmer();
    sfc.setVisible(true);
    }could you please help me, and tell me what to add or to modify,,
    Thank you..                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

    realahmed8 wrote:
    thanks masijade,
    i have filter the file chooser for only text files,
    but i still don't know how to use FileReader to put text file content to the text area (ta) ..
    please tell me how and where to use it..How? -- See the IO Tutorials on Sun for the FileReader (and I assume you know how to call setText and append in the JTextArea).
    Where? -- In the actionPerformed method (better would be a separate thread that is triggered through the actionPerformed method, but that is probably beyond you at the moment), of course.
    Give it a try.

  • Where are these unix executable files coming from and how do I recover the original text file?

    where are these unix executable files coming from and how do I recover the original text file?

    When you upgraded to Lion did you have AppleWorks installed on your mac?
    Most of the AW documents can be opened by Pages 09 or Numbers 09 with most of the orginal format in tact. (I do not know if previouse verision will work) just open the AW file with both and see which one works best.
    Text Edit will also open most of the AW files as well but will require a lot of work to restore them to their orginal format.
    If you have AW Database documents then they are not supported. 
    These document show up as "exec icons", Kind: Unix Executagle File.
    They also will show up as .cwk file if they are small files. I have a couple that were under 1mb that are shown as " Kind: AppleWorks Document" but will not open.
    The only option to open AW database is to have AW installed on a mac with a pre-Lion OS to recover the file.

  • How to modify the contents of a text file stored along with a midlet

    Hi,
    I have been developing a application in j2me wherein i need to first read the contents of the text file stored along with the midlet and later erase the existing content and update it with some text.
    I was able to read the file in the following manner
    InputStream is = getClass().getResourceAsStream("myfile.txt");
    Now i need to erase the contents and then update it the new content, how do i do it. Kinldy please help me out. It is very urgent.
    Thanks

    Didn't you hear me the first time?
    http://forum.java.sun.com/thread.jspa?threadID=701360&messageID=4068435#4068435

  • How can u insert and retrieve text files in any format using forms6i.

    how can u insert and retrieve text files in any format using forms6i.
    can u give me an example of an insert statement, let's assume the file is located in the a:drive.
    and retrieving the files, i would give the user a list of all the files that are in the database, the user would select one, but what command(or piece of code) would open the file in its apppropriate editor.
    e.g .pdf formatted file would open in acrobat.
    any help would be appreciated.
    Thanks
    Hussein Saiger

    the filereference class is for downloading and uploading files.
    if you want to load xml, use the xml class.
    and, if you want to write to an xml file and don't want to use server-side code, wait.

  • I need to insert Pages text file at end of a file; i.e., making one long document from several files. insert 'file' is not option in toolbar. how do i do this?

    i need to insert a Pages text file at end of another file; in other words, i'm making one long file from several files.  "insert file" is not an option in the toolbar, so how do i do this?

    cass516 wrote:
    this method sounds like a PAIN but of course i have no choice but to try it.  Why would Pages make such a simple thing so troublesome?  in other programs, you simply click 'insert file'.
    The only thing odd about Pages' Insert file is that it doesn't do its own format.
    You obviously think that MsWord is "The Norm" but I found really odd things that it won't do. To the point I, like others here, can't be bothered trying to drive the Word square peg into the Mac round hole.
    Mostly Pages works by drag and drop, I'm puzzled why that doesn't work with the thumbnails. But then there are quite a few oddities in every program. Pages is far from an exception.
    Peter

  • I have one file ss_fpga.rbt,abcd.txt how to know the details of the file

    i have  one file  ss_fpga.rbt,abcd.txt how to know  the details  of the file  (when was the date created ,when was date modfied,owner) any function is there like   GetFileInfo

    Yes there is some, called stat(), look the links in your post in stack overflow, there is a lot of link in the anser.
    They talk about sys/stat.h a C header, witch contain the stat() function.
    stat() return a lot of things (size, changes, access etc) about files. look the "here" everywhere in the Yann anser, UP his anser and put the subject as resolved.
    Thanks,

  • How to know the process chain start time and end time

    Hi Experts,
                   How to know the process chain start time  and end time .
    Thanks in advance
    Regards
    Gutti
    Edited by: guttireddy on Feb 23, 2012 11:30 PM

    Hi Reddy,
    You may find the run time of a PC using below steps.
    1. Call SE38 > /SSA/BWT > Execute  > Enter your PC , choose the date and time > Execute. Here Run-time of a PC is displayed. (or)
    2. Call RSPC1 > Enter your PC > Execute > Goto Log view > Right click on the start Variant > Displaying Messages > Note down the start time in Chain Tab. Now Right click on the last Process type of the PC > Displaying Messages > Note down the End time in Chain Tab. The Difference b/w start time and end time gives the Run-time of your PC.
    Hope this helps.
    Regards
    Sai

  • How do I export v-card formatted files for use with either Numbers or Excel?

    How do I export v-card formatted files for use with either Numbers or Excel?

    Did you open Automator and just look around?
    Actions are listed in the left pane.
    You drag them into the workflow on the right in the order you need to process the items that you want.
    If this is a on-off requirement, just make a Workflow. If you plan to use it often, make it an Application.
    If you want to select the contacts you want to export, use a get Selected action. You'd then select the contacts in Contacts App before running the workflow.
    I'm not on a Mac to take screenshots, so you'll have to look at Automator's help or google for more info.

  • Working with line feed, carriege return, tab etc in JSP web layout

    Hi guys,
    After looking at an old thread
    line feed, carriege return, tab etc in JSP web layout
    I think I am experiencing the same problem here and I'm struggling to implement the solution, mainly because I am a complete newbie at jsp reports (and most things webby).
    1) Can I add the code following code directly to the web source? If not then how do I find the css file being used?
    table pre {
    overflow-x: auto; /* Use horizontal scroller if needed; for Firefox 2, not needed in Firefox 3 */
    white-space: pre-wrap; /* css-3 */
    white-space: -moz-pre-wrap !important; /* Mozilla, since 1999 */
    /* width: 99%; */
    word-wrap: break-word; /* Internet Explorer 5.5+ */
    2) I'm not sure how to set the width to be same as the width of the table cell.
    Here's the web source and thanks very much in advance!
    <%@ taglib uri="/WEB-INF/lib/reports_tld.jar" prefix="rw" %>
    <%@ page language="java" import="java.io.*" errorPage="/rwerror.jsp" session="false" %>
    <%@ page contentType="text/html;charset=ISO-8859-1" %>
    <!--
    -- Version control data:
    -- $Revision: $
    -- $Date: $
    -->
    <!--
    <rw:report id="report" parameters="userid=xxx/xxx@xxx">
    <rw:objects id="objects">
    </rw:objects>
    -->
    <html>
    <head>
    <meta name="GENERATOR" content="Oracle 9i Reports Developer"/>
    <title> STAR Solution Plan Report </title>
    </head>
    <body>
    <!-- Data Area Generated by Reports Developer -->
    <rw:dataArea id="MG2GRPFR69">
    <rw:foreach id="RG2691" src="G_issue_solution">
    <!-- Start GetGroupHeader/n --> <table>
    <TABLE border=0 cellPadding=0 cellSpacing=0 width="100%" style="font-family: Book Antiqua; font-size: 10pt">
    <TBODY>
    <TR>
    <TD vAlign=center align="left">
    <p><IMG src="http://witton3/star/Docs/EU_Man/TIMET_Logo.jpg" width="150" height="77"><br>
    </p>
    </TD>
    <TD vAlign=center align="right">
    <p><IMG src="http://witton3/star/Docs/EU_Man/Star_Logo.gif" width="116" height="46">
    </p>
    </TD>
    </TR></TBODY></TABLE>
    <p align=center style='margin-right:.5in;margin-left:.5in;text-align:center'><span
    style='font-size:18.0pt;font-family:"Book Antiqua"'>STAR System Documentation</span></p>
    <p align=center style='margin-right:.5in;margin-left:.5in;text-align:center'>
    <u><b><span
    style='font-size:13.5pt;font-family:"Book Antiqua"'>Solution Plan for STCR </span><font size="4"><span style="font-family: Book Antiqua">
    <rw:field id="F_issue_id" src="issue_id" breakLevel="RG2691" breakValue=" "> F_issue_id </rw:field>
    </span></b></u></font></p>
    <P>NOTE: <font color="#008000">For existing STAR programs, unless explicitly
    stated in the solution plan, functionality pre-existing in the program or report
    will be retained. Approval of the solution  plan implies agreement that
    current functionality not being modified is still acceptable going forward, in
    the light of the specific changes documented. </font></P>
    <b><u><p>Root Cause of Issue</b></u></p>
    <p> <rw:field id="F_root_cause" src="root_cause" breakLevel="RG2691" breakValue=" "> F_root_cause </rw:field>
    </p>
    <b><u><p>Overview of Solution</b></u></p>
    <p> <rw:field id="F_solution_overview" src="solution_overview" breakLevel="RG2691" breakValue=" "> F_solution_overview </rw:field>
    </p>
    <b><u><p>Functionality Changes</b></u></p>
    <b><p>After implementation of these changes the users will now be able to:</b></p>
    <p> <rw:field id="F_sp_new_functionality" src="sp_new_functionality" breakLevel="RG2691" breakValue=" "> F_sp_new_functionality </rw:field>
    </p>
    <b><p>After implementation of these changes the users will no longer be able to:</b></p>
    <p> <rw:field id="F_sp_removed_functionality" src="sp_removed_functionality" breakLevel="RG2691" breakValue=" "> F_sp_removed_functionality </rw:field>
    </p>
    <b><p>After implementation of these changes the users will need to do this differently:</b></p>
    <p> <rw:field id="F_sp_changed_functionality" src="sp_changed_functionality" breakLevel="RG2691" breakValue=" "> F_sp_changed_functionality </rw:field>
    </p>
    <b><u><p>Program Units Affected</b></u></p>
    <!-- End GetGroupHeader/n --> <tr>
    <td valign="top">
    <table summary="STAR System Documentation" border="1" width="100%" style="font-family: Book Antiqua; font-size: 10pt">
    <!-- Header -->
    <thead>
    <tr>
    <th width="100" align="left" <rw:id id="HBprgunittype69" asArray="no"/>> <b><font face="Book Antiqua">Program <br>Unit Type </font></b></th>
    <th width="200" align="left" <rw:id id="HBprgunitname69" asArray="no"/>> <b><font face="Book Antiqua">Program Unit Name </font></b></th>
    <th align="left" <rw:id id="HBdescofchange69" asArray="no"/>> <b><font face="Book Antiqua">Description of Change </font></b></th>
    <th align="left" <rw:id id="HBtechnotes69" asArray="no"/>> <b><font face="Book Antiqua">Technical Notes </font></b></th>
    </tr>
    </thead>
    <!-- Body -->
    <tbody>
    <rw:foreach id="RG1691" src="G_issue_prg_units">
    <tr>
    <td width="100" align="left" valign="top" <rw:headers id="HFprgunittype69" src="HBprgunittype69"/>> <font face="Book Antiqua" size="2"><rw:field id="Fprgunittype69" src="program_unit_type" nullValue=" "> F_prgunittype </rw:field></font></td>
    <td width="200" align="left" valign="top" <rw:headers id="HFprgunitname69" src="HBprgunitname69"/>> <font face="Book Antiqua" size="2"><rw:field id="Fprgunitname69" src="program_unit_name" nullValue=" "> F_prgunitname </rw:field></font></td>
    <td <rw:headers id="HFdescofchange69" src="HBdescofchange69"/>> <font face="Book Antiqua" size="2"><rw:field id="Fdescofchange69" src="sp_description_of_change" nullValue=" "> F_descofchange </rw:field></font></td>
    <td <rw:headers id="HFtechnotes69" src="HBtechnotes69"/>> <font face="Book Antiqua" size="2"><rw:field id="Ftechnotes69" src="sp_technical_notes" nullValue=" "> F_technotes </rw:field></font></td>
    </tr>
    </rw:foreach>
    </tbody>
    </table>
    </td>
    </tr>
    <b><u><p>Security</b></u></p>
    <p> <rw:field id="F_sp_security" src="sp_security" breakLevel="RG2691" breakValue=" "> F_sp_security </rw:field>
    </p>
    <b><u><p>Site Specific data /processing</b></u></p>
    <p> <rw:field id="F_sp_site_specific_info" src="sp_site_specific_info" breakLevel="RG2691" breakValue=" "> F_sp_site_specific_info </rw:field>
    </p>
    <b><u><p>Impacts and restrictions</b></u></p>
    <p> <rw:field id="F_sp_impacts_and_restrictions" src="sp_impacts_and_restrictions" breakLevel="RG2691" breakValue=" "> F_sp_impacts_and_restrictions </rw:field>
    </p>
    <b><u><p>Pre-Implementation data modifications</b></u></p>
    <p> <rw:field id="F_sp_pre_imp_data_mods" src="sp_pre_imp_data_mods" breakLevel="RG2691" breakValue=" "> F_sp_pre_imp_data_mods </rw:field>
    </p>
    <b><u><p>Post Implementation user actions</b></u></p>
    <p> <rw:field id="F_sp_post_imp_data_mods" src="sp_post_imp_data_mods" breakLevel="RG2691" breakValue=" "> F_sp_post_imp_data_mods </rw:field>
    </p>
    </table>
    </rw:foreach>
    </rw:dataArea> <!-- id="MG2GRPFR69" -->
    <!-- End of Data Area Generated by Reports Developer -->
    </body>
    </html>
    <!--
    </rw:report>
    -->

    The solution in the original post was:
    set the
    width to be same as the width of the table cell
    add following class to css file
    table pre {
    overflow-x: auto; /* Use horizontal scroller if needed; for Firefox 2, not needed in Firefox 3 */
    white-space: pre-wrap; /* css-3 */
    white-space: -moz-pre-wrap !important; /* Mozilla, since 1999 */
    /* width: 99%; */
    word-wrap: break-word; /* Internet Explorer 5.5+ */
    But I dont have a css file ... can I just add this to the web source and if so where?

  • How do I read from a text file that is longer than 65536 lines and write the data to an Excel spreadshee​t and have the data write to a new column once the 65536 cells are filled in a column?

    I have data that is in basic generic text file format that needs to be converted into Excel spreadsheet format.  The data is much longer than 65536 lines, and in my code I haven't been able to figure out how to carry over the data into the next column.  Currently the conversion is done manually and generates an Excel file that has a total of 30-40 full columns of data.  Any suggestions would be greatly appreciated.
    Thanks,
    Darrick 
    Solved!
    Go to Solution.

    No need to use nested For loops. No need for any loop anyway. You just have to use a reshape array function. The picture below shows how to proceed.
    However, there may be an issue if your element number is not a multiple of the number of columns : zero value elements will be added at the end of the last column in the generated 2D array. Now the issue depends on the way you intend store the data in the Excel spreadsheet : you could convert the data as strings, replace the last zero values with empty strings, and write the whole 2D array to a file (with the .xls extension ) using the write to spreadsheet function. Only one (minimal) problem : define the number of decimal digits to be used;
    or you could write the numeric array directly to a true Excel spreadsheet, using either the NI report generation tools or ActiveX commands, then replace the last elements with empty strings.
    We need more input from you to decide how to solve these last questions. 
    Message Edité par chilly charly le 01-13-2009 09:29 PM
    Chilly Charly    (aka CC)
             E-List Master - Kudos glutton - Press the yellow button on the left...        
    Attachments:
    Example_VI.png ‏10 KB

  • How to import data from a text file into a table

    Hello,
    I need help with importing data from a .csv file with comma delimiter into a table.
    I've been struggling to figure out how to use the "Import from Files" wizard in Oracle 10g web-base Enterprise Manager.
    I have not been able to find a simple instruction on how to use the Wizard.
    I have looked at the Oracle Database Utilities - Overview of Oracle Data Pump and the Help on the "Import: Files" page.
    Neither one gave me enough instruction to be able to do the import successfully.
    Using the "Import from file" wizard, I created a Directory Object using the Create Directory Object button. I Copied the file from which i needed to import the data into the Operating System Directory i had defined in the Create Directory Object page. I chose "Entire files" for the Import type.
    Step 1 of 4 is the "Import:Re-Mapping" page, I have no idea what i need to do on this page. All i know i am not tying to import data that was in one schema into a different schema and I am not importing data that was in one tablespace into a different tablespace and i am not R-Mapping datafiles either. I am importing data from a csv file.
    For step 2 of 4, "Import:Options" page, I selected the same directory object i had created.
    For step 3 of 4, I entered a job name and a description and selected Start Immediately option.
    What i noticed going through the wizard, the wizard never asked into which table do i want to import the data.
    I submitted the job and I got ORA-31619 invalid dump file error.
    I was sure that the wizard was going to fail when it never asked me into which table do i want to import the data.
    I tried to use the "imp" utility in command-line window.
    After I entered (imp), i was prompted for the username and the password and then the buffer size as soon as i entered the min buffer size I got the following error and the import was terminated:
    C:\>imp
    Import: Release 10.1.0.2.0 - Production on Fri Jul 9 12:56:11 2004
    Copyright (c) 1982, 2004, Oracle. All rights reserved.
    Username: user1
    Password:
    Connected to: Oracle Database 10g Enterprise Edition Release 10.1.0.2.0 - Produc
    tion
    With the Partitioning, OLAP and Data Mining options
    Import file: EXPDAT.DMP > c:\securParms\securParms.csv
    Enter insert buffer size (minimum is 8192) 30720> 8192
    IMP-00037: Character set marker unknown
    IMP-00000: Import terminated unsuccessfully
    Please show me the easiest way to import a text file into a table. How complex could it be to do a simple import into a table using a text file?
    We are testing our application against both an Oracle database and a MSSQLServer 2000 database.
    I was able to import the data into a table in MSSQLServer database and I can say that anybody with no experience could easily do an export/import in MSSQLServer 2000.
    I appreciate if someone could show me how to the import from a file into a table!
    Thanks,
    Mitra

    >
    I can say that anybody with
    no experience could easily do an export/import in
    MSSQLServer 2000.
    Anybody with no experience should not mess up my Oracle Databases !

  • How to execute code from a text file?

    Hello all!
    How to execute some code lines from a text file? For example my file is:
    String varname = "somecontents";
    JFrame frame = new JFrame();
    frame.setVisible(true);How can I get contents of this file and parse them if I want get new JFrame and access to the variable varname?

    I mean the PHP would generate a readable Java source,
    for example some variables with some data, and I just
    dont know what to do with file if I want generate the
    xls file from my saved data, could You help? :)Some variables, some data, PHP, Java, XLS file??? Al rather vague.
    You need to explain in more detail what it is you're trying to do if you want an answer to your question!

  • How to work on 2 open text files in one main program

    I write to one text file and then I close it. I then open another text file in the same "main" class but I cannot write to this file - I get the following error: "Exception in thread "main" java.util.NoSuchElementException".
    Here's the code with the line underlined, at which point the error above gets reported:
    import java.io.*;
    import java.util.*;
    public class TwoFileStudentMarks
    public static void main(String[] args) throws IOException
    PrintWriter stFile = new PrintWriter (new FileWriter ("stFil.txt"));
    Scanner kbd = new Scanner(System.in);
    int lineNum = 0;
    System.out.println("Type in a name: (ZZZ to stop)");
    String name = kbd.nextLine();
    while (!name.equalsIgnoreCase("ZZZ"))
    stFile.println(name);
    lineNum++;
    System.out.print("Input next name: (ZZZ to stop)");
    name = kbd.nextLine();
    stFile.close();
    kbd.close();
    PrintWriter tstFile = new PrintWriter (new FileWriter ("tstFil.txt"));
    kbd = new Scanner(System.in);
    for (int j=0; j<lineNum; j++)
    for (int i=0; i<3; i++)
    System.out.print("For student " + j + " enter test " + i + ": ");
    int tst = kbd.nextInt();
    tstFile.print(tst+" ");
    tstFile.println();
    tstFile.close();
    kbd.close();
    } // end main     
    } // end class

    Thank You for responding to my question. I am new to the forum. I have posted only ONE question since joining on Novemebr 5th, 2007. So I have a question. What are tags  and how does one include them in a question that one wishes to post to the forum?
    Secondly, my experience of Java is only about 10 months. So any advice, tips, replies are greatly appreciated and most welcome, so that I may continue to use this language.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

Maybe you are looking for

  • How do you connect an NTFS hard drive for time machine???

    So I have this 1.5 TB hard drive connected like so: 1.5 TB HDD ==========> Wifi Router (configured to be accessible using FTP, and SMB, also able to connect using HTTP, but haven't tried)                        (USB)                 ||               

  • Flash video, Macs and Acrobat 9

    So I can now "insert" Flash video into my PDFs that I create in Acro 9 Pro. I just can't "convert" other video file types to Flash in Acrobat unless I'm using Extended on a PC, right? But once I have the video as an FLV, I'm good? Thanks! dc

  • I have a Macbook Pro and can no longer access Number I keep getting an error message 1712 please help

    I have a MacBook Pro and for some unknown reason I can't open numbers I keep getting a message error -1712 I can't open old documnents not the program

  • JPDK Sample Provider compile error

    Hi I have installed 'OracleAS Containers for J2EE Pre-configured PDK', version 9.0.4. The Portlal tools are running fine, but the 'JPDK Sample Provider' fails with a compile error: 500 Internal Server Error OracleJSP: oracle.jsp.provider.JspCompileEx

  • Problems with plugins message no registry

    Hi EveryOne: PLS I need your help. I have a message : No registry in java.library.path I need migrate from access to oracle. Regards Felix