Importing a text file

Hi to everyone,
I am new in programming and trying to complete a task given to me. And i might be stupid but i need help with this one... i think it is a simple task to do for a experienced developer. I am short on time to submit it so i would appreciate any help is possible ASAP.
Task: Implement a menudriven
student management system implemented in Java. The
main menu should support the following options:
<ul class="unIndentedList"><li>Load students</li>
<ul><li>Loads a list of students from the text file students.txt</li>
<li>If the file does not exist, the program should not crash - you should</li>
</ul>
</ul>
simply print a message to the user that the file does not exist and return.
<ul class="unIndentedList"><li>Save students</li>
<ul><li>Saves a list of students to the text file students.txt</li>
<li>If the file cannot be written to, a message should be displayed to the user</li>
</ul>
</ul>
before returning to the main menu
<ul class="unIndentedList"><li>List students by number</li>
<ul><li>List all students sorted by student number (increasing)</li>
</ul>
<li>List students by age</li>
<ul><li>List all students by age, then by name (increasing)</li>
</ul>
<li>Add student</li>
<ul><li>Add a new student from the keyboard. Should read in the name (no need</li>
</ul>
</ul>
to seperate first and last names), age, and student number for the student.
<ul class="unIndentedList"><li>Find student</li>
<ul><li>Ask the user for a student number and try to find and display the student</li>
</ul>
</ul>
with that student number
<ul class="unIndentedList"><li>Delete student</li>
<ul><li>Same as Find Student, except that if the student is found they will be</li>
</ul>
</ul>
removed from the list of stored students.
<ul class="unIndentedList"><li>Quit</li>
</ul>
Exit the program. This option should ask the user if they want to save their
changes, but only if changes have been made since the last Save Students
operation.
Main Menu:
(1) Load students
(2) Save students
(3) List students by number
(4) List students by age
(5) Add student
(6) Find student
(7) Delete student
(8) Quit
Please choose an option from 1 to 8:
Even how to start on it? I have some code ready, but definetelly i am going to need help, as i said i am a "looser" in the are and due to problems missed a lot of lectures :((((

valeri87 wrote:
I am new in programming and trying to complete a task given to me. And i might be stupid but i need help with this one... i think it is a simple task to do for a experienced developer. I am short on time to submit it so i would appreciate any help is possible ASAP.Simply dumping the assignment verbatim here without showing effort may not be the best way to get help.
You may with to speak to the teacher and get help or even drop the class if you are too far behind. If you want help here, though you'll find that we are much better at answering specific questions then trying to undo a student's semester of falling behind. You should consider going to the Sun tutorials and learning as much as possible, and then trying to solve as much of the assignment as you can. When you get stuck, then post your code with a specific question, and you'll likely get helpful help. Good luck.
Edited by: Encephalopathic on Jul 16, 2009 3:16 PM

Similar Messages

  • Error while importing a text file for a list of values

    Hi Experts,
    While importing a text file for a list of values in designer, I am getting error message as below:
    "Invalid setting in Excel key of the Engines section of the Windows Registry. (3433)".
    I am using BO XI R3. Universe Designer version : 12.1.0.882
    Any suggestion ?
    Regards

    plzzzzzzzzzzzzzzzzz.............sme1 help me out

  • "Import from Text File" & "Upload from Clipboard" icon not appearng in F110

    Hi Experts,
    While making the payment to the vendors through TN F110, in "PARAMETER" screen just next to 'STATUS' screen, there is a vendor field for selection in range and just ahead of this there is an icon for multiple vendor selection ( Bold arrow mark ). If I click on that multiple vender selection icon ( on bold arrow mark ), an another screen opens for multiple selection for vendors. In this screen 'Enter, Copy, Delete etc' icons are appearing at the bottom of the screen but "Import from Text File" & "Upload from Clipboard" icon are not appearing there.
    Can you please let me know how to bring that icons there?
    Points would be awarded.
    Rgds,
    Shailesh

    Hi Ravi,
    I have not yet created anything and have just entered the parameter. In the multiple screen for vendors there are 5 fields for individual and 5 for range selection. Even you can put more than five range selections or individual selections by clicking on the page button but there I am not finding these two icons.
    Can you please check at your end and let me know if you are getting or what to do to bring those two icons in F110.
    Rgds,
    Shailesh

  • When I import a text file(comma separated )into a numbers spread sheet all the data goes into one column. Why does the text not go into separate columns based on the commas.

    When I import a text file(comma separated) into a numbers spreadsheet all the data goes into one column instead of individual columns based on the comma separators.  Excel allows you to do this during the import..  Is there a way to accomplish this in numbers without opening it in Excel and the importing into Numbers.

    Your user info says iPad. This is the OS X Numbers forum. Assuming you are using OS X… Be sure the file is named with a .csv suffix.
    (I don't have an iPad, so I don't know the iOS answer.)

  • How to import a text file created in Pages (iWork '08) to Photoshop Elements

    I am totally a novice at working with Photoshop Elements.  I need help.  I want to create my business card in Photoshop Elements with a background image and then a text layer over the background layer.  The logo and text was created in Pages (iWork '08).  Can I import this text file to Photoshop Elements and if so how do I do that?  I cannot create the same logo in Elements unless someone can tell me how to draw a circle with a transparent background so that just the outline of the circle shows and the background comes through.  Thanks for any help you can offer.  I have OS X Snow Leopard 10.6.4 and Photoshop Elements 6.

    In PSE, to draw an empty circle use the elliptical marquee tool and hold down shift while you drag to constrain it to a circle. That will give you an empty selection, then go to Edit>Stroke (outline) selection. A window appears where you can choose the width and color of the stroke.
    However, I'm not understanding why you would want to create your business card in PSE rather than in Pages or equivalent. Is there a special reason for this?
    EDIT As for the text file, it would be simpler just to retype it in PSE, since it can't be very much text. Remember that PSE doesn't do all the fancy things with text that Pages can, although it can do some things (like warping) that Pages can't.
    You could activate the text tool and use copy/paste, but you'll lose most of the formatting.

  • Importing a text file with variable values into web reporting

    Hello,
    I'm looking for a possibility to import values from a text file into a variable selection in Web reporting.
    With BEx reporting in Excel this is possible, by clicking on the multiple selection button in the variable popup screen, and subsequently selecting the "Import from Text file" button.
    However, this function seems not to be available for web-reporting...
    It would be great if someone could help me out with this!
    Thanks & regards,
    Arvid

    Hi,
    we could resolve this issue, so i thought it may also be helpful for others:
    In our example we used a file with numbers for materials. This file is stored somewhere in a directory, to which SAP BI must have authorization to read.
    The file looks something like this:
    4711
    4712
    4713
    4714
    The file is named "import.txt" and lays in directory "/usr/sap/EC6/files/bi/"
    *&  Include           ZXRSRU01
    * global variables
    Data: intern_range LIKE LINE OF i_t_var_range,
          l_s_range    TYPE rsr_s_rangesid,
          line(100)    TYPE c,
          p_file(128)  TYPE c,
          length_rangelow  type i,
          tmp_rangelow     like l_s_range-low.
    * internal tables for selection-transfer from transaction
    * Data: BEGIN OF it_file occurs 0,
    *        it_p_file(128) TYPE c,
    *      END of it_file.
    IF i_step = 1.
    ** variables can be changed or set before pop-up appears
      CASE i_vnam.
    * take material from external file to selection-list
         WHEN 'ZSD_UPMA'.
    ** call of transaction, with which the path can be set
    *CALL TRANSACTION 'ZBW_VARIABLE' using it_file
    *MODE 'A'      " call should be visible, so that variable can be set
    *UPDATE 'S'.   " first transaction, then processing
    ** Der Pfad, der in dem Selektionsbild eingegeben wird, wird an die Variable übergeben
    ** Der Set-Parameter ist in Report ZSD_SELECT_VARIABLE
    *  get parameter id 'VAR' field p_file.
    p_file = '/usr/sap/EC6/files/bi/import.txt'.
    * further handling of variable in BI
          OPEN DATASET p_file FOR INPUT IN TEXT MODE ENCODING DEFAULT.
          IF sy-subrc = 0.
            READ DATASET p_file INTO line.
            WHILE sy-subrc = 0.
              IF line(2) <> '//'.
                l_s_range-sign = 'I'.
                l_s_range-opt  = 'EQ'.
                l_s_range-low  = line.
    * fill with leading Zeros
    * in variable tmp_rangelow the value from l_s_range-low is taken
        tmp_rangelow    = l_s_range-low.
    * read the length
        length_rangelow = strlen( tmp_rangelow ).
    * in our case: material has 18 characters
        while length_rangelow lt 18.
          CONCATENATE '0' tmp_rangelow INTO tmp_rangelow.
          length_rangelow = length_rangelow + 1.
        endwhile.
    * initialize l_s_range-low
        clear l_s_range-low.
    * set with filled values
        l_s_range-low = tmp_rangelow.
    * transfer to structure
                APPEND l_s_range TO e_t_range.
              ENDIF.
              READ DATASET p_file INTO line.
            ENDWHILE.
          ENDIF.
          CLOSE DATASET p_file.
        ENDCASE.
    ELSEIF i_step = 2.
    ** in step 2 all variable values from pop-up input can be processed or
    ** User Exit variables can be derived
    * UserExit Ende.
    ENDIF.
    Hope i could help!
    Best regards,
    Tobias

  • Problem in bulk import of text files in SQL Server

    Hi,
    I am using sql server 2012 x 64 and trying to import some text files (tab/ comma separated) and ms access files in sql server tempdb
    I am trying bulkinsert on text file but it is inserting all data in a single line in sql while in text file I have 1000K lines,
    Then I tried importing other data using openrowset from access file but I am getting following error
    Cannot create an instance of OLE DB provider "MSDASC" for linked server "(null)".
    can any one please provide some assistance . If I am able to upload the data from flat text file then it will be enough as I am getting data in tsv or csv format
    Nitin

    If this is a one-off, I think you should try the import/export wizard in SQL Server Management Studio instead. This may be easier to get working.
    If you want to this import on a regular basis with BULK INSERT, we need to see the CREATE TABLE statement for your table and a sample file. Best if you can upload the file on Skydrive, Dropbox or similar, as the exact bytes matters.
    To connect to an Access database, you use the ACE provider. Never heard of MSDASC before.
    Erland Sommarskog, SQL Server MVP, [email protected]

  • How can we import a text file in Labview,Is this process require CIN utility

    Hi,
    I am working in physics lab where i am working on labview and want to import a text file in labview, if anyone knows ,please mail me at [email protected]

    Hi Ajay,
    See attached V 7.0 example...
    Hope it helps,
    Nick
    Attachments:
    Read_txt_File.vi ‏20 KB

  • I'm creating an epk and I need to add a bio to the menu.  Can I import the text file or do I need to retype the bio somewhere?  What is the best way to proceed?

    I'm creating an epk and I need to add a bio to the menu.  Can I import the text file or do I need to retype the bio somewhere?  What is the best way to proceed?

    Electronic Press Kit.
    Usually in the form of video outtakes, movie trailers, cast and crew interviews. Basically, the stuff that gets bunged onto commercial DVDs as extras or ends up on late night TV "Making Of..." shows.
    To answer the OP, you want a button on the menu that leads to a still image, or series of them, set up as a slide show. You can copy/paste the text in DVD Studio and then add formatting via the Text menu. (Highlight the text and right click to access formatting controls). Or do it in a graphics application using the appropriate video image preset.

  • Importing a text file and displaying it

    Ok, my goal is to import a text file which i have done. I want to import it into a 2D array. There are 26 rows and 2 columns. Basically just a translator program. This is what i have to load the text file into java. But i am having trouble displaying the array with the data loaded into it. any ideas?
    public static void loadData(String a[][])
         throws java.io.IOException
         String file = "C:\\print.txt";
         String inLine;
         int row;
         FileReader fr = new FileReader(file);
         BufferedReader br = new BufferedReader(fr);
         for (row = 0; row<=26;row++)
              a[row][0] = br.readLine();
              a[row][1] = br.readLine();     
         br.close();     
         System.out.println(a[row][0]);
         }     

    my goal for this program is to have a user enter a phrase to be translated. I have the text file that i am loading into java that has the english word and then the translated word. I want to load that into the 2D array and display it. Then use a stringtokenizer for the translate part. But the problem i have right now is trying to display the data that was loaded into the array. any ideas?

  • Import a text file into database

    If anybody could help me with this, i would GREATLY appreciate it! I need to write a procedure to import a text file into an oracle database table. -Thanks!

    See my response in Re: import a text file into database.
    Cheers, APC

  • What happened to importing plain text files in iTunes?

    I used to be able to export the playlist containing all the music I wanted to listen to as a plain text file. I would then import this file into a spread sheet, sort as I desired, assign each song a number, sort on that number and save the resulting groups to plain text files. I would then import these text files as playlists. It appears that this capability has disappeared in the current version of iTunes. I am capable of working with the xml if I have to, but that is more effort than I think is necessary. Have I missed something?

    I have been thinking about what you are suggesting and even with your last reply it does not solve the problem. I suspect you still do not see what I am driving towards. I have playlists for all songs with 5 starts, all songs with 4 stars, all songs with number of plays less than n. I also have playlists of those three that have not been played in n days. I listen to those sometimes. I also listen to my existing playlists which contain subsets all music not christmas and have at least a 3 start rating. This last set is not smart at present. With the current setup, music in those first 3 playlists get played more often. Any smart playlist that has to include not played in the last x will not play those songs more often unless I play those playlists more often. At present, to generate those non smart playlists I export, divide, and import information. Apple has changed the format it accepts on input. I either have to accept their new import method and start programming, or find a smart playlist method that solves this problem. I do not believe that anything yet suggested for smart solves the problem. The closest I have come is 3 playlists. One smart and two dumb. The smart one is all songs with rating above 3 and not christmas that have not been played in last x and is not in the two dumb ones and limit to 100. The dumb ones start empty. Let it populate, drag the list to one of the dumb ones. Let the smart one recompute. Drag it to the second dumb one. Play one list on each device. When playlist finishes, blank the dumb one for that device, sync, let iTunes repopulate the smart list, drag to dumb list and sync again. In the long term, I think I am better off programming.

  • Tabular: Import from text file error : The provider 'Microsoft.ACE.OLEDB.12.0' is not registered.

    I'm trying to import a text file into a tabular model in SSDT
    windows7 64 bit
    I have office 2013 32bit installed. Will not uninstall this as I need it.
    How do I import a csv file into the tabular model?
    i've downloaded both 32 and 64 bit access redistributables from here: http://www.microsoft.com/en-au/download/details.aspx?id=39358
    64 bit refuses to install (already have 32bit office tools installed)
    32 doesn't stop the error - i'd assume i'd already have the correct 32 bit drivers installed since i have the full office 2013 suite installed.
    I've looked at some of the other topics around and they are either unanswered or the poster didn't have office installed so could install 64bit redist
    Thanks
    Jakub @ Adelaide, Australia Blog

    see if this helps
    http://visakhm.blogspot.in/2011/11/excel-2010-export-import-issue-in-64.html
    Please Mark This As Answer if it solved your issue
    Please Mark This As Helpful if it helps to solve your issue
    Visakh
    My MSDN Page
    My Personal Blog
    My Facebook Page

  • Importing a text file into a variable

    I have a text file that I would like to import as a variable in javascript. I would like to do some editing to the text in the script before I place it into the page. I have the script splitting text into an array and the different parts need to go to different places... I have everything working for me except for importing the text from a file into a variable (right now I'm defining the variable from within the script).
    Any help would be appreciated!
    -Shane

    In Javascript you could use this:
    var f = File ('/d/books/mytextfile.txt');
    if (f.exists)
    f.open ('r', undefined, undefined);
    var textfile_contents = f.read();
    f.close ();
    Peter

  • Importing a Text File to Database

    Hi There,
    Years ago with limited Coldfusion experience I created a Cold fusion process (below) that deletes the contents of a database table and inserts the contents of a 7mb text file which is passed via FTP down to our web server at regular intervals. Admittingly the code below is probably clunky to the more experienced, however i have found this process to work for the last 4 years without a problem. Recently my web server (shared hosted environment) has been throwing this error when this page runs,
    "Request aborted due to heavy system load.",
    I asked my host if there has been any changes, extra sites recently added to the server that may be causing this congestion which they naturally replied "no". I even tried reducing the text file size to about 3mb but still got the same issue. Is there any other more efficient coldfusion code options I can try that may be quicker and prevent the error from being thrown?
    Im on Coldfusion 7 and using MS SQL server, database and coldfusion are on differnt boxes in a shared environment.The text file can contain null values and is delimeted by a pipe character "|"
    Any help appreciated
    <cfsetting requesttimeout="600">
    <cftransaction>
    <cfquery name="delete" datasource="#client.dsn#" username="#client.username#" passWord="#client.password#">
    delete from xxxxxx
    </cfquery>
    <cfhttp method="get" textqualifier=" " username="xxxxx" password="xxxxxx" firstrowasheaders="no" delimiter="|" name="test" url="http://xxxxxxxxxxxxxx/br_orders.txt">
    Records Read <cfoutput>#test.recordcount#</cfoutput>
    <cfloop query="test">
    <cfquery name="insert" datasource="#client.dsn#" username="#client.username#" passWord="#client.password#">
    INSERT INTO xxxxx
    (OrderNo, Line, AccountNo, AccountNoShip, Shipment, PurchaseOrder, Completed, OrderDate, ShipmentDate, Product, QtyOrdered, QtyShipped, Price, Carrier, Connote, Delivery1, Delivery2, Delivery3, Delivery4, Delivery5, Delivery6, Delivery7, Delivery8, expected)
    VALUES (
    <cfqueryparam value='#test.column_1#' cfsqltype="cf_sql_varchar">,
    <cfqueryparam value='#test.column_2#' cfsqltype="cf_sql_varchar">,
    <cfqueryparam value='#test.column_3#' cfsqltype="cf_sql_varchar">,
    <cfqueryparam value='#test.column_4#' cfsqltype="cf_sql_varchar">,
    <cfqueryparam value='#test.column_5#' cfsqltype="cf_sql_varchar">,
    <cfqueryparam value='#test.column_6#' cfsqltype="cf_sql_varchar">,
    <cfqueryparam value='#test.column_7#' cfsqltype="cf_sql_varchar">,
    <cfqueryparam value='#test.column_8#' cfsqltype="cf_sql_varchar">,
    <cfqueryparam value='#test.column_9#' cfsqltype="cf_sql_varchar">,
    <cfqueryparam value='#test.column_10#' cfsqltype="cf_sql_varchar">,
    <cfqueryparam value='#test.column_11#' cfsqltype="cf_sql_float">,
    <cfqueryparam value='#test.column_12#' cfsqltype="cf_sql_float">,
    <cfqueryparam value='#test.column_13#' cfsqltype="cf_sql_float">,
    <cfqueryparam value='#test.column_14#' cfsqltype="cf_sql_varchar">,
    <cfqueryparam value='#test.column_15#' cfsqltype="cf_sql_varchar">,
    <cfqueryparam value='#test.column_16#' cfsqltype="cf_sql_varchar">,
    <cfqueryparam value='#test.column_17#' cfsqltype="cf_sql_varchar">,
    <cfqueryparam value='#test.column_18#' cfsqltype="cf_sql_varchar">,
    <cfqueryparam value='#test.column_19#' cfsqltype="cf_sql_varchar">,
    <cfqueryparam value='#test.column_20#' cfsqltype="cf_sql_varchar">,
    <cfqueryparam value='#test.column_21#' cfsqltype="cf_sql_varchar">,
    <cfqueryparam value='#test.column_22#' cfsqltype="cf_sql_varchar">,
    <cfqueryparam value='#test.column_23#' cfsqltype="cf_sql_varchar">,
    <cfqueryparam value='#test.column_24#' cfsqltype="cf_sql_varchar">
    </cfquery>
    </cfloop>
    <cfparam name="OZ" default=""><cfset OZ=#dateAdd("h",18,now())#>
    <cfset OZ=#CreateODBCDateTime(OZ)#>
    <cfquery datasource="#client.dsn#" username="#client.username#" password="#client.password#">
    UPDATE
    UpdateTimes
    SET
           time=#OZ#
      WHERE
      id=<cfqueryparam value="1" cfsqltype="cf_sql_integer">
    </cfquery>
    </cftransaction>

    Girish Sharma wrote:
    "I would be really grateful."
    But now OP will not really grateful to you; because;
    1.You are not going to perform/import the data at his machine.
    2.You have not given him the required control file.... (even without knowning anything)
    3.You have given only SQL Loader word; so now "oaf... i have to read Doc.."
    Regards
    Girish SharmaHahahaha . Supper.. ROFL! :)

  • Unable to import merep text file as a data object in DOE

    Dear All,
    I have exported a sync bo from MI 2.5 system, to a text file. Then i have tried importing the same text file into DOE. Then the following error has occured.
    "No active nametab exists for ZEFLMI_DOC_HDR_T51".
    I am unable to understand what could be the problem. Can someone please help me, how to resolve this issue, so that syncbo can be imported as a data object.
    Regards,
    Kiran.

    Hi,
    The backend for middleware should be same as what it was in MI.
    the erro comes when the corrosponding structure in a bapi doesnot exists in current backend.
    Please check if the structure ZEFLMI_DOC_HDR_T51 exists in backend.
    Thanks,
    Rohit

Maybe you are looking for

  • How can i make an apple id without visa card??

    how can i make an apple id without visa card??

  • Best practice for component layout?

    Hi,can people tell me their views on best practice in this area, using JSF. Eg, say I want this:     LabelSml    InputField     LabelLarge  InputField... ie 2 labels, 2 fields, vertically alligned, and with some space between the label and the field.

  • Delete app. or photos

    how do you delete photos or app. from the iPad?

  • Encrypt & decrypt memory card

    how can i do  decryption  of a memory card in nokia E66 model.. can u tell the procedure ... i already encrypt the card now i cant acces the card ie cant open music file ,images etc... 

  • SDK Acrobat 3D!!!!!

    Prompt please where to download sdk Acrobat 3D Developer (for export x-files into PDF, C++, C#)