Unixx shel script - combing information from 2 files into one useing looping structur
Please support our Shell Scripting advertiser: Programming Forums
![]() |
•
•
Posts: 24
Reputation:
Solved Threads: 0
Unixx shel script - combing information from 2 files into one useing looping structur
#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..
: 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..
•
•
Posts: 24
Reputation:
Solved Threads: 0
Re: Unixx shel script - combing information from 2 files into one useing looping structur
#2
Apr 9th, 2008
•
•
Posts: 148
Reputation:
Solved Threads: 26
Re: Unixx shel script - combing information from 2 files into one useing looping structur
#3
Apr 9th, 2008
what have you learnt in that online class so far? do you have lecture notes and books for shell scripting?
•
•
Posts: 24
Reputation:
Solved Threads: 0
Re: Unixx shel script - combing information from 2 files into one useing looping structur
#4
Apr 9th, 2008
•
•
Posts: 148
Reputation:
Solved Threads: 26
Re: Unixx shel script - combing information from 2 files into one useing looping structur
#5
Apr 9th, 2008
try this document instead. almost all you need to know about shell
•
•
Posts: 399
Reputation:
Solved Threads: 47
Re: Unixx shel script - combing information from 2 files into one useing looping structur
#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
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!
------------------------------------------------------------------------
The greatest viral marketing idea of all time, get your copy of this Free Report now!
•
•
Posts: 24
Reputation:
Solved Threads: 0
Re: Unixx shel script - combing information from 2 files into one useing looping structur
#7
Apr 9th, 2008
•
•
Posts: 24
Reputation:
Solved Threads: 0
Re: Unixx shel script - combing information from 2 files into one useing looping structur
#8
Apr 9th, 2008
•
•
Posts: 24
Reputation:
Solved Threads: 0
Re: Unixx shel script - combing information from 2 files into one useing looping structur
#9
Apr 9th, 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
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
•
•
Posts: 148
Reputation:
Solved Threads: 26
Re: Unixx shel script - combing information from 2 files into one useing looping structur
#10
Apr 10th, 2008
have you read the line i gave about while loops? pseudocode.
while read -r name number
do
while read -r NAME NUM
do
if NAME is equal name
then
echo name NUM number
done < "file2"
done < "file1"![]() |
Other Threads in the Shell Scripting Forum
- Previous Thread: Required Hardware information in Linux & solaris.
- Next Thread: compare 2 files
•
•
•
•
Views: 2403 | Replies: 13 | Currently Viewing: 1 (0 members and 1 guests)





Linear Mode