LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
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 02-28-2014, 05:11 AM   #1
mehreen124
LQ Newbie
 
Registered: Feb 2014
Posts: 13

Rep: Reputation: Disabled
Query based Search Engine..Help required.


Its very urgent and I have no idea how to even get started with it. If anyone can only explain it to me how to start and explain what am I supposed to do in this question.
Design a Query based Search Engine which can categorize email addresses
on basis of Domain name. Make a supposition that recognized domains
are (@gmail.com, @hotmail.com, @yahoo.com, @nu.edu.pk). Text files based report must
be generated reflecting:
You must use Functions for each requirement mentioned below. In total there should be atleast 4 functions.
 Percentage of Email Occurrences of unique domain. ( A duplicate email entry must be
counted once)
 Create a filter to remove duplicate entries from data set and store the result in a file
named “filtered_data.txt”.
 Separate files for each unique domain name consisting of emails belong to it.
 Set the permissions of files that only owner can read and write, also make these files hidden through script.
 
Old 02-28-2014, 06:36 AM   #2
TenTenths
Senior Member
 
Registered: Aug 2011
Location: Dublin
Distribution: Centos 5 / 6 / 7
Posts: 3,475

Rep: Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553
-Homework Assignment Alert-

Why not ask your tutor for clarification on the requirements?

Other than that, yes, it all looks like it can be done, however as you don't tell us what you can / can't use, what platform it is, whether you have access to a database or are having to do this all with "flat" files and BASH shell scripts we can't really help.

As with your other thread, post what you've done and we might be able to point you in the right direction.

Oh, and "It's very urgent", it may be for you, but as we all offer our time and experience for free it's not particularly urgent for us.
 
Old 02-28-2014, 06:52 AM   #3
mehreen124
LQ Newbie
 
Registered: Feb 2014
Posts: 13

Original Poster
Rep: Reputation: Disabled
Using flat files and shell scripting. I just need some direction as to how am i supposed to do this task
Thankyou in advance for any any help offered.
 
Old 02-28-2014, 07:02 AM   #4
TenTenths
Senior Member
 
Registered: Aug 2011
Location: Dublin
Distribution: Centos 5 / 6 / 7
Posts: 3,475

Rep: Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553
Query based Search Engine..Help required.

Thing - Command
Searching - grep
Sorting - sort
Counting - wc -l
Splitting line into fields - awk or cut if they are fixed width
Filtering - uniq
Piping output through different commands - |

A lot depends on the source data file format, the above commands should give you a start.
 
1 members found this post helpful.
Old 02-28-2014, 07:18 AM   #5
szboardstretcher
Senior Member
 
Registered: Aug 2006
Location: Detroit, MI
Distribution: GNU/Linux systemd
Posts: 4,278

Rep: Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694
Quote:
Originally Posted by TenTenths View Post
Thing - Command
Searching - grep
Sorting - sort
Counting - wc -l
Splitting line into fields - awk or cut if they are fixed width
Filtering - uniq
Piping output through different commands - |

A lot depends on the source data file format, the above commands should give you a start.
Looks to me like they are looking for a pure bash script that does this via functions.
 
Old 02-28-2014, 07:35 AM   #6
Habitual
LQ Veteran
 
Registered: Jan 2011
Location: Abingdon, VA
Distribution: Catalina
Posts: 9,374
Blog Entries: 37

Rep: Reputation: Disabled
Here's something that can perhaps be modified,

Good luck.
 
Old 02-28-2014, 08:19 AM   #7
mehreen124
LQ Newbie
 
Registered: Feb 2014
Posts: 13

Original Poster
Rep: Reputation: Disabled
if I have a file which is full of email id's of various domains and I want to use that file to calculate the percentage of Email Occurrences then how am I supposed to link that file to the function where I actually calculate the percentage of unique occurrence? how can I make checks on the data in that .txt file?
 
Old 02-28-2014, 08:27 AM   #8
szboardstretcher
Senior Member
 
Registered: Aug 2006
Location: Detroit, MI
Distribution: GNU/Linux systemd
Posts: 4,278

Rep: Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694
Have you been paying attention in class? Doing the labs and such?

Have you even tried googling for this information?

We are not here to do your homework step by step for you. If you have a problem, either research it yourself, or post the code you have tried writing that is giving you the problem.
 
Old 02-28-2014, 08:34 AM   #9
mehreen124
LQ Newbie
 
Registered: Feb 2014
Posts: 13

Original Poster
Rep: Reputation: Disabled
I have never been using any such forums before and doing all my work by myself. I never asked for the solution to my question, only asked for a little guidance. We were not taught such things, thats y I had to ask and learn myself.
Anyways thankyou for all the help.
 
Old 02-28-2014, 08:47 AM   #10
szboardstretcher
Senior Member
 
Registered: Aug 2006
Location: Detroit, MI
Distribution: GNU/Linux systemd
Posts: 4,278

Rep: Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694
Thats righteous that you are doing the work by yourself to learn something. Everyone will agree.

But, you aren't trying the researching bit very hard, evidenced by this: I went to google and typed in part of your question, and the second result is an entire conversation about this exact thing. It took me less than 3 seconds.

http://lmgtfy.com/?q=calculate+the+p...nces+in+a+file

Again, if you need help with part of your code, post it and ask a question. Because it's easier to understand your question when you post the code related to the question.
 
1 members found this post helpful.
Old 02-28-2014, 09:03 AM   #11
TenTenths
Senior Member
 
Registered: Aug 2011
Location: Dublin
Distribution: Centos 5 / 6 / 7
Posts: 3,475

Rep: Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553
Let's have a little play......

data.txt
Code:
abc@example.com,Mr,Alf,Bravo,"Ordered Cake"
abc@example2.com,Mrs,Anne,Bravo,"Ordered Coffee"
abc@example.com,Mr,Alf,Bravo,"Ordered Coffee"
aaa@example.com,Mrs,Aurora,Ardvark,"Ordered Coffee"
abc@example.com,Mr,Alf,Bravo,"Ordered Cake"
Count the number of unique e-mail addresses in the file
Code:
awk -F, {'print $1'} data.txt | sort | uniq | wc -l
Returns 3, as expected.

Removed complete duplicates from the file
Code:
sort dats.txt | uniq
Result:
Code:
aaa@example.com,Mrs,Aurora,Ardvark,"Ordered Coffee"
abc@example2.com,Mrs,Anne,Bravo,"Ordered Coffee"
abc@example.com,Mr,Alf,Bravo,"Ordered Cake"
abc@example.com,Mr,Alf,Bravo,"Ordered Coffee"
So, as you can see with the commands I gave you to look at you can process a data file in a number of ways.

Good luck and come back with what you're trying.
 
Old 03-01-2014, 11:48 PM   #12
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,358

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
If this is part of a class (which it sounds like), then your class notes/book should give you all the pieces you need. If they are not clear ask your instructor.

As above, show us your code; we are here to help, but not to give the soln.

You should read this http://rute.2038bug.com/index.html.gz and see also http://www.grymoire.com/Unix/Awk.html, http://www.grymoire.com/Unix/Sed.html.
 
Old 03-02-2014, 01:26 AM   #13
grail
LQ Guru
 
Registered: Sep 2009
Location: Perth
Distribution: Manjaro
Posts: 10,006

Rep: Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191
I am with chrism01, you say you are doing a course but it is expecting you to learn the course material on your own???

Either you have not been paying attention or you have been ripped off
 
  


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
[SOLVED] Which search engine does LinuxQuestions use when you use 'Search'? Robert.Thompson LQ Suggestions & Feedback 7 12-15-2010 04:49 PM
LXer: Wiki-based search engine launched LXer Syndicated Linux News 0 01-09-2008 12:50 PM
Search engine Hammett LQ Suggestions & Feedback 5 01-10-2007 03:03 PM
Search Engine? phek Linux - General 1 09-20-2001 07:00 PM

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

All times are GMT -5. The time now is 09:00 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