Unixx shel script - combing information from 2 files into one useing looping structur

Please support our Shell Scripting advertiser: Programming Forums - DaniWeb Sister Site
Reply

Join Date: May 2007
Posts: 24
Reputation: cyberman111 is an unknown quantity at this point 
Solved Threads: 0
cyberman111 cyberman111 is offline Offline
Newbie Poster

Unixx shel script - combing information from 2 files into one useing looping structur

 
0
  #1
Apr 9th, 2008
HEY, I am new at this but I am in a middle of an excercise for an online class I am taking and I am doing a exercise and I am stuck. the instruction are as follow

: write a shell script that will take information from 2 fles and comine into another file
use looping structure


the files are
1) names with dates
2)same names with numebrs


and the out put should be
in order by date "ex monday, tuesday..
Reply With Quote Quick reply to this message  
Join Date: May 2007
Posts: 24
Reputation: cyberman111 is an unknown quantity at this point 
Solved Threads: 0
cyberman111 cyberman111 is offline Offline
Newbie Poster

Re: Unixx shel script - combing information from 2 files into one useing looping structur

 
0
  #2
Apr 9th, 2008
I have the files inputed but I just dont know what loop statement to use and to get it to print it in a file in order by date
Reply With Quote Quick reply to this message  
Join Date: Apr 2006
Posts: 149
Reputation: ghostdog74 is on a distinguished road 
Solved Threads: 40
ghostdog74 ghostdog74 is offline Offline
Junior Poster

Re: Unixx shel script - combing information from 2 files into one useing looping structur

 
0
  #3
Apr 9th, 2008
what have you learnt in that online class so far? do you have lecture notes and books for shell scripting?
Reply With Quote Quick reply to this message  
Join Date: May 2007
Posts: 24
Reputation: cyberman111 is an unknown quantity at this point 
Solved Threads: 0
cyberman111 cyberman111 is offline Offline
Newbie Poster

Re: Unixx shel script - combing information from 2 files into one useing looping structur

 
0
  #4
Apr 9th, 2008
yes I do , I ahve read the looping chapter but dont really understand which loops to use cause the examples are different
Reply With Quote Quick reply to this message  
Join Date: Apr 2006
Posts: 149
Reputation: ghostdog74 is on a distinguished road 
Solved Threads: 40
ghostdog74 ghostdog74 is offline Offline
Junior Poster

Re: Unixx shel script - combing information from 2 files into one useing looping structur

 
0
  #5
Apr 9th, 2008
try this document instead. almost all you need to know about shell
Reply With Quote Quick reply to this message  
Join Date: Oct 2007
Posts: 399
Reputation: eggi will become famous soon enough eggi will become famous soon enough 
Solved Threads: 47
eggi eggi is offline Offline
Posting Whiz

Re: Unixx shel script - combing information from 2 files into one useing looping structur

 
0
  #6
Apr 9th, 2008
Hey There,

Do you have a skeleton of a script. Just whatever you tried that isn't working? If you post that here, more folks are likely to respond and get you to the answer you need quickly.

Best wishes,

Mike
Linux and Unix Tips, Tricks and Individual Advice - The Linux and Unix Menagerie!
------------------------------------------------------------------------
The greatest viral marketing idea of all time, get your copy of this Free Report now!
Reply With Quote Quick reply to this message  
Join Date: May 2007
Posts: 24
Reputation: cyberman111 is an unknown quantity at this point 
Solved Threads: 0
cyberman111 cyberman111 is offline Offline
Newbie Poster

Re: Unixx shel script - combing information from 2 files into one useing looping structur

 
0
  #7
Apr 9th, 2008
yes how do I copy and paste it in word
Reply With Quote Quick reply to this message  
Join Date: May 2007
Posts: 24
Reputation: cyberman111 is an unknown quantity at this point 
Solved Threads: 0
cyberman111 cyberman111 is offline Offline
Newbie Poster

Re: Unixx shel script - combing information from 2 files into one useing looping structur

 
0
  #8
Apr 9th, 2008
SEE THE THING IS, i HAVE 2 FILES ONE WITH NAMES WITH DAYS AND THE OTHER WITH NAMES AND NUMBERS. SOMEHOW I NEED TO TAKE INFORMATION FROM BOTH FILES AND PUT IT IN ONE FILE USING LOOP STATEMENT. I HAVE NO CLUE WEHRE TO START I MADE THE FILES BUT NOW IM STUCK ON THE PATH TO TAKE
Reply With Quote Quick reply to this message  
Join Date: May 2007
Posts: 24
Reputation: cyberman111 is an unknown quantity at this point 
Solved Threads: 0
cyberman111 cyberman111 is offline Offline
Newbie Poster

Re: Unixx shel script - combing information from 2 files into one useing looping structur

 
0
  #9
Apr 10th, 2008
Please help!!!!
ok
the first file is this

dave 734
bob 313
carol 248
mary313
ted248


the second file is
bob tuesday
carol monday
ted sunday
alice wed
dave thurs

the output has to be

name on call phone
carol mon 248
bob tues 313
alice wed 616

etc...

i need to put this in one file using looop structure
i have no clue how to do this
i made the 2 files and now im just confused and really depressed. i cant seem to fig out wat to do next
Reply With Quote Quick reply to this message  
Join Date: Apr 2006
Posts: 149
Reputation: ghostdog74 is on a distinguished road 
Solved Threads: 40
ghostdog74 ghostdog74 is offline Offline
Junior Poster

Re: Unixx shel script - combing information from 2 files into one useing looping structur

 
0
  #10
Apr 10th, 2008
have you read the line i gave about while loops? pseudocode.
Shell Scripting Syntax (Toggle Plain Text)
  1. while read -r name number
  2. do
  3. while read -r NAME NUM
  4. do
  5. if NAME is equal name
  6. then
  7. echo name NUM number
  8. done < "file2"
  9. done < "file1"
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Other Threads in the Shell Scripting Forum


Views: 2794 | Replies: 13
Thread Tools Search this Thread



Tag cloud for Shell Scripting
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC