473,618 Members | 3,044 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Need java help on reading intger elements from file to array list

needhelp123
21 New Member
Hi all,

any body could help in reading integer values from .txt to array list and after transferring the dates from array list to another .txt file

there should be two files....
May 21 '07 #1
29 2781
prometheuzz
197 Recognized Expert New Member
Hi all,

any body could help in reading integer values from .txt to array list and after transferring the dates from array list to another .txt file

there should be two files....

Sure, with what part of the assignment are you having trouble with?
May 21 '07 #2
nomad
664 Recognized Expert Contributor
Hi all,

any body could help in reading integer values from .txt to array list and after transferring the dates from array list to another .txt file

there should be two files....
Question you need to ask yourself
How do you want to retreive your text files. by a scanner or static.
how do you want to output your t.txt file.
How many data types do you need.
Where do you want to store the output txt files
nomad
May 21 '07 #3
needhelp123
21 New Member
Sure, with what part of the assignment are you having trouble with?

the following information is enought i hope...
* Create a file called Unsorted.txt.
* Store the Unsorted values in this file.
* Read the values from the Unsorted.txt file.
* Sort the values
* Store the sorted values in new file. Name it as Sorted.txt

Implement this only for the following algorithms.

Bubble sort
May 21 '07 #4
needhelp123
21 New Member
Question you need to ask yourself
How do you want to retreive your text files. by a scanner or static.
how do you want to output your t.txt file.
How many data types do you need.
Where do you want to store the output txt files
nomad
I hope following information is enough....

* Create a file called Unsorted.txt.
* Store the Unsorted values in this file.
* Read the values from the Unsorted.txt file.
* Sort the values
* Store the sorted values in new file. Name it as Sorted.txt

Implement this only for the following algorithms.

Bubble sort
May 21 '07 #5
nomad
664 Recognized Expert Contributor
I hope following information is enough....

* Create a file called Unsorted.txt.
* Store the Unsorted values in this file.
* Read the values from the Unsorted.txt file.
* Sort the values
* Store the sorted values in new file. Name it as Sorted.txt

Implement this only for the following algorithms.

Bubble sort
Have you read how to I/O files yet and do you know how to create a Arraylist?

nomad
May 21 '07 #6
prometheuzz
197 Recognized Expert New Member
the following information is enought i hope...
* Create a file called Unsorted.txt.
* Store the Unsorted values in this file.
* Read the values from the Unsorted.txt file.
* Sort the values
* Store the sorted values in new file. Name it as Sorted.txt

Implement this only for the following algorithms.

Bubble sort
What I meant to say with my post is this: if you don't have any idea where (or how) to start coding *something*, then I cannot help you and you should either hire a private tutor or have a talk with your teacher (I don't mean to put you down!).

But, if you have coded something up and you're getting compiler/runtime errors you don't understand what they mean: post your code AND errors here and explain what it is you're having a hard time with: I'll try to help you.

Good luck.
May 21 '07 #7
nomad
664 Recognized Expert Contributor
I hope following information is enough....

* Create a file called Unsorted.txt.
* Store the Unsorted values in this file.
* Read the values from the Unsorted.txt file.
* Sort the values
* Store the sorted values in new file. Name it as Sorted.txt

Implement this only for the following algorithms.

Bubble sort
like prometheuzz we can not help you without see some form of coding.
I'm also new to Java and I willing to help you learn Java from an entry level view points

good luck
May 21 '07 #8
needhelp123
21 New Member
Have you read how to I/O files yet and do you know how to create a Arraylist?

nomad
i know all the things....
to read and create array list
and even i have the program tooo

i need a code where i can transfer data from text to array list....
i am not aware of this little bit...

if i kno this so i can implement the rest...
May 21 '07 #9
needhelp123
21 New Member
What I meant to say with my post is this: if you don't have any idea where (or how) to start coding *something*, then I cannot help you and you should either hire a private tutor or have a talk with your teacher (I don't mean to put you down!).

But, if you have coded something up and you're getting compiler/runtime errors you don't understand what they mean: post your code AND errors here and explain what it is you're having a hard time with: I'll try to help you.

Good luck.

hi prometheuzz
thanks for your concern... i have the program code just i need to know about how to transfer integer data from text file to array list...
May 21 '07 #10

Sign in to post your reply or Sign up for a free account.

Similar topics

4
1515
by: Jason | last post by:
Could anyone spare some time and try to help me out. I've got a .txt data file with a name, pin, balance seperated by commas. I am opening the file and using Split to split it between the ,'s I need to read it into an array and then check if what was entered as a name by the user is in the array. Can anyone be of help? Please Skype me, using the Text chat of skype. I can transfer code just using text.....I have the code written...
7
7651
by: greenflame | last post by:
I am trying to reorder elements of a list and I am stuck as to what might be the best way to approach this. I have a (main) list of elements and another (ordering) list (which is may shorter, but not longer than the main list) which contains the order in which I want the elements of the main list but only as far along as the length of the ordering list. This may be confusing so I will try to give an example. Suppose the main list is:...
4
3465
by: Fazana | last post by:
I need help for reading a text file into in my java program. The file contains this information: ID# Student’s Answers --------------------------- 236499 TFTFTFTFFFFTFTFFFTF 643828 TFTFTTTTTF FTFTFTTF 917057 FTF FTTTFFFTF FTFTFT 656565 FTF FTFTFTF TTFT TTT
3
3570
by: Ant | last post by:
Hi, I'm using an array list as the collection for my indexer (_alPeople). When i try to set _alpeople to a value at a certain index, I get an error. I can't simply add the value as it needs to be at an index set by the user. the Set statement is this: _people = value; or even _people.Insert(index,value); but these throw 'ArgumentOutOfRange' exception stating: Must be non-negative and less than the size of the collection.
8
1994
by: bahoo | last post by:
Hi, I have a text file containing a single line of text, such as 0024 How should I read it into a "list"? I tried this, but the "join" did not work as expected. Any suggestions?
6
2923
by: Lisa | last post by:
I am reading in data from a text file. I want to enter each value on the line into a list and retain the order of the elements. The number of elements and spacing between them varies, but a typical line looks like: ' SRCPARAM 1 6.35e-07 15.00 340.00 1.10 3.0 ' Why does the following not work: line = ' SRCPARAM 1 6.35e-07 15.00 340.00 1.10 3.0 '
4
2263
by: jla1357 | last post by:
In my program I need to read in a file, search for 100 unique words, and count how many times a found word has been found all by using an array. This is what I have so far, but when the file is found it simply returns zero. please any help would be great #include <iostream> #include <fstream> #include <string> using namespace std; const int LIST_SIZE = 100;
5
2154
by: Justin | last post by:
Here's my XML: <?xml version="1.0" ?> <AppMode Type="Network"> <CurrentFolder Path="c:\tabs"> <Tabs> <FilePath>tabs\Justin.tab</FilePath> <FilePath>tabs\Julie.tab</FilePath> *****There could be 1 of these or 100....quantity can change***** </Tabs>
4
1929
by: zcabeli | last post by:
Hi, i'd like to have an easy way of doing IO operation in files : my main 2 tasks are : 1. reading line from file. for this i've created the following function : sub read_line { my $filename = shift; my $index = shift; open FILE, $filename or die "can't open $filename"; my @text = <FILE>; return $text;
0
8212
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8153
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8455
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7126
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5552
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4065
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4150
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2587
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1760
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.