473,385 Members | 1,890 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Readin a file

2
Hello:
i need to read a file line by line because there is diferent information in each line that i need to take out separatly, i'm using the while construction like this
while ($file = <FILE>){
@data = split(/\s/, $file);
but i also need to recognise if one of the elemts of the array is repeated in the next lines of the file because if it is i must to take them out together.
Does someone know how i can do it??
thank you very much
Apr 26 '07 #1
1 1176
Do you mean to say that you want to take only the unique elements? Otherwise please give the query clearer.
Apr 26 '07 #2

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

Similar topics

2
by: matt | last post by:
I have compiled some code, some written by me, some compiled from various sources online, and basically i've got a very simple flat file photo gallery. An upload form, to upload the photos and give...
5
by: Dave Smithz | last post by:
Hi There, I have a PHP script that sends an email with attachment and works great when provided the path to the file to send. However this file needs to be on the same server as the script. ...
1
by: boriss111 | last post by:
Hi, How can I read interer number form the *.txt file? I have a matrix of integer numbers stored in *.txt file, like this 3 7 7 12 12 10 14 7 8 and I have to read those numbers as numbers...
13
by: Rick | last post by:
The following code will enter an infinate loop when in ReadChars. I can only make it happen when reading a Stream and with this particular XML. If I use the ReadInnerXml call rather than my own...
2
by: Marc | last post by:
So i have a text file where each line represents a button name. What the code I need to read this file and creatre a new button from each line.. so far I just have code to read the whole...
1
by: belley | last post by:
I have this simple file: ********* <?xml version="1.0" encoding="ISO-8859-1"?> <books:names xmlns:books="http://www.w3.org/1999/xlink"> <book:name xmlns:book="http://www.w3.org/1999/xlink"...
11
by: Victor Lagerkvist | last post by:
Greetings, I know it's usually a bad habit to include several questions in a single message, but they are quite related. I have declared and defined a function named readin, whose purpose is to...
4
by: thaiZilla | last post by:
How do i read a file permission? i know that ls -l *filename* will list all information about the file including file permissions eg -rwxr-xr-x 1 norman.thai users 187 Jan 15 10:33 firstline... ...
7
by: vinay3744 | last post by:
Hello I am particularly new to programming working on a mathematical analysis where I have to perform some functions on a text file. I have a text file in this format, it contains 3 numbers in...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

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.