LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 05-11-2011, 02:33 AM   #1
aruna t
LQ Newbie
 
Registered: May 2011
Posts: 7

Rep: Reputation: 0
set operations for strings in unix


hello sir,
can u please let me know unix commands to implement set operations on strings.
 
Old 05-11-2011, 03:02 AM   #2
grail
LQ Guru
 
Registered: Sep 2009
Location: Perth
Distribution: Manjaro
Posts: 9,552

Rep: Reputation: 2899Reputation: 2899Reputation: 2899Reputation: 2899Reputation: 2899Reputation: 2899Reputation: 2899Reputation: 2899Reputation: 2899Reputation: 2899Reputation: 2899
You might need to explain just a little further? What background are you using for 'set'? Maybe an example would help.
 
Old 05-11-2011, 06:10 AM   #3
aruna t
LQ Newbie
 
Registered: May 2011
Posts: 7

Original Poster
Rep: Reputation: 0
i need set operations like symmetric difference in order to remove strings in one set and not in another set. here i mean "set theory" for set operations
 
Old 05-11-2011, 07:14 AM   #4
grail
LQ Guru
 
Registered: Sep 2009
Location: Perth
Distribution: Manjaro
Posts: 9,552

Rep: Reputation: 2899Reputation: 2899Reputation: 2899Reputation: 2899Reputation: 2899Reputation: 2899Reputation: 2899Reputation: 2899Reputation: 2899Reputation: 2899Reputation: 2899
Right .. so nothing to do with set command .. you can see how more explanation is needed

Maybe you might now also allude to what language you are using? The idea here is not for us to pull the questions out of you but for you to give information we can assist with.
 
Old 05-11-2011, 09:22 AM   #5
aruna t
LQ Newbie
 
Registered: May 2011
Posts: 7

Original Poster
Rep: Reputation: 0
i want to use unix. the problem is am unable to find unix commands to get the required output..the problem goes like this
there are two files in which i store characters...i want to take the symmetric difference and find which characters are not in common..am not findin unix commands to do these operations on strings...hope u got it..
 
Old 05-11-2011, 09:37 AM   #6
grail
LQ Guru
 
Registered: Sep 2009
Location: Perth
Distribution: Manjaro
Posts: 9,552

Rep: Reputation: 2899Reputation: 2899Reputation: 2899Reputation: 2899Reputation: 2899Reputation: 2899Reputation: 2899Reputation: 2899Reputation: 2899Reputation: 2899Reputation: 2899
Well not a 100% sure but try - man diff

Are we talking on a line by line basis or word by word ... sorry if I am being a little dense

As you are coming from Windows ... maybe you could tell me what function / command you would use there and I can suggest something similar?
 
Old 05-11-2011, 10:34 AM   #7
makyo
Member
 
Registered: Aug 2006
Location: Saint Paul, MN, USA
Distribution: {Free,Open}BSD, CentOS, Debian, Fedora, Solaris, SuSE
Posts: 730

Rep: Reputation: 75
Hi.

There is a utility called combine, which may be able to help.

However, my first suggestion is:
Quote:
To obtain the best answers quickly when you want help in
processing datasets -- extracting, transforming, filtering,
then:

1. Post representative samples of your data (i.e. data that
should "succeed" and data that should "fail")

2. Post what you expect the results to be, instead of trying
only to describe them. Be clear about how the results are to be
obtained, e.g. "add field 2 in file1 to field 3 from file2"

3. Post what you have attempted to do so far.

4. Place the data and expected output within CODE tags, so that
they are more easily readable.

Special cases, exceptions, etc., are very important to include
in the samples.
Best wishes ... cheers, makyo
 
Old 05-11-2011, 01:06 PM   #8
aruna t
LQ Newbie
 
Registered: May 2011
Posts: 7

Original Poster
Rep: Reputation: 0
for ex set A contains some variables used in program like a,total,avg...etc and set B contains some variables b,c sum...etc
so i want to know which of them in common and which are not..i want to output the variables which are in common..
 
Old 05-13-2011, 08:29 AM   #9
aruna t
LQ Newbie
 
Registered: May 2011
Posts: 7

Original Poster
Rep: Reputation: 0
sir i have written a shell script to match the line numbers in a data flow tabel to retreive specific variables.now i want to perform some set operations as mentioned above to match some more variables..can u pls help me out..
 
Old 05-15-2011, 01:33 PM   #10
astromime
LQ Newbie
 
Registered: May 2011
Posts: 26

Rep: Reputation: 13
what does your script look like?
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
JAVA -> operations on STRINGs mayaabboud Programming 9 03-13-2008 10:18 AM
binary set operations--2D(openGL) basak Programming 3 10-22-2006 06:02 PM
binary set operations--2D(openGL) basak Linux - Software 1 10-21-2006 05:52 PM
Resource strings for Unix Sam Hobbs Programming 5 07-12-2002 11:09 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 05:45 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration