LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
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


Closed Thread
  Search this Thread
Old 12-04-2009, 01:09 AM   #1
nightmare520
LQ Newbie
 
Registered: Dec 2009
Posts: 2

Rep: Reputation: 0
Question [I'm a newbie] How can to cut a string and compare it, then send email for them...


How can to solve this with Shell Script?
I have a file (data.txt)
Code:
Customer's Name | Email                 | Phone No.
Mr. A           | mr.a@yahoo.com        | 01701234567
Mr. B           | mr.b@gmail.com        | 01712345678
Mrs. C          | mrs.c@hotmail.com     | 01723456789
Ms. D           | ms.d@yahoo.com        | 01709876543
Mrs. E		| mrs.e@gmail.com	| 01724567890
And i want to compare a Phone No. column.
If it was started by 0170 then send them an email with content (content4VIP.txt)..

Code:
You're a VIP member. you are donate 100USD..
else send them an email with content (content4Gold.txt)..
Code:
You're a Gold member. you are donate 50USD..
I have a big problem with the programming languages..
-----------------Thx------------------
-----------------For------------------
-------------->> Help <<--------------

PS: Sorry, i don't know where can post it!
 
Old 12-04-2009, 01:51 AM   #2
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,578
Blog Entries: 31

Rep: Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208
What did you learn in class? Which resources are you using to learn shell scripting? What have you tried so far. LQ does not exist to do your homework for you but will help you when you try yourself and get stuck.

BTW, the English of what you want to mail them is bad; better "You have donated USD50."
 
Old 12-04-2009, 06:42 AM   #3
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Mint
Posts: 17,809

Rep: Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743
Per the LQ Rules, please do not post homework assignments verbatim. We're happy to assist if you have specific questions or have hit a stumbling point, however. Let us know what you've already tried and what references you have used (including class notes, books, and Google searches) and we'll do our best to help. Also, keep in mind that your instructor might also be an LQ member.

Please feel free to start a new thread in accord with these guidelines.
 
  


Closed Thread



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
Help to cut a string deepudixit Programming 5 11-28-2009 08:21 AM
how to compare date string?? loplayers Linux - Newbie 1 11-29-2007 08:40 PM
compare string in SQL hus Programming 9 04-27-2005 10:17 AM
compare string in C++ danxl Programming 3 11-02-2003 02:14 PM

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

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