LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 01-18-2007, 10:25 PM   #1
mblames
Member
 
Registered: Apr 2006
Location: Place for all OpenSource
Distribution: OpenBSD 4.1, FC5
Posts: 50

Rep: Reputation: 15
Comparing Line Per Line In Shell Programming


Hi all,
Can someone help me with shell programming, I want to compare line per line from file. The file contains :

1234
1234
1234
3123
3123
1232
2323

And it will compare line per line, so every line will be non-identical.
so it will be like this :

1234
3123
1232
2323

Thanks b4



Regards

Last edited by mblames; 01-18-2007 at 10:54 PM.
 
Old 01-18-2007, 10:29 PM   #2
osdeals
Member
 
Registered: Jul 2006
Distribution: RHEL, CentOS, PuppyLinux, SuSe, Ubuntu, Debian
Posts: 59

Rep: Reputation: 15
Not very sure i understood your requirement. Seems you're looking for the 'uniq' command, which will find all unique items (lines) in the file.

In case the requirement is different, please elaborate.
 
Old 01-18-2007, 10:57 PM   #3
mblames
Member
 
Registered: Apr 2006
Location: Place for all OpenSource
Distribution: OpenBSD 4.1, FC5
Posts: 50

Original Poster
Rep: Reputation: 15
Im requiring a script that reads and compare line per line.
And the write the output to another file, just like filtering.
So the output file will have the non-identical 'string'.

'uniq' eh ?
I'try it, thank u


Regards
 
Old 01-18-2007, 11:37 PM   #4
mblames
Member
 
Registered: Apr 2006
Location: Place for all OpenSource
Distribution: OpenBSD 4.1, FC5
Posts: 50

Original Poster
Rep: Reputation: 15
Well its working
Thanks a lot friend


Regards
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
bash shell script read file line by line. Darren[UoW] Programming 57 04-17-2016 06:07 PM
C++ text file line by line/each line to string/array Dimitris Programming 15 03-11-2008 08:22 AM
graphical programming, draw a line for example? Inprise Programming 9 11-21-2004 10:17 AM
How to delete a line from a text file with shell script programming Bassam General 1 01-28-2004 08:51 PM
linux scripting help needed read from file line by line exc commands each line read atokad Programming 4 12-26-2003 10:24 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 11:13 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration