How to produce a file by many files?


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting How to produce a file by many files?
# 8  
Old 04-29-2009
yea the file missing is showing who is missing in the file, 20179687 is missing in the file Prac 3, so i need to print it to the file missing.
# 9  
Old 04-29-2009
oooo sorry i make wrong

20179687 Prac3
20781637 Prac2, Prac3
# 10  
Old 04-29-2009
can anyone please help me??

Thank you....
# 11  
Old 04-29-2009
i got something like this:

Code:
#!/bin/sh

cat Students |while read Student_ID
do 
	for(i=1; i -le 3; i++)
	cat Prac$i |while read ID
		if [ Student_ID -ne ID ]
		then
			if [Student_ID exist in file Missing]
			then
			echo ", Prac$i" >>Missing
			else
			echo "Student_ID: Prac$i" >>Missing
			fi
		fi
done

but it is not working, can someone please change it for me and how can i add things at the end of each line??
Thank you
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Join two files combining multiple columns and produce mix and match output

I would like to join two files when two columns in each file matches with each other and then produce an output when taking multiple columns. Like I have file A 1234,ABCD,23,JOHN,NJ,USA 2345,ABCD,24,SAM,NY,USA 5678,GHIJ,24,TOM,NY,USA 5678,WXYZ,27,MAT,NJ,USA and file B ... (2 Replies)
Discussion started by: mady135
2 Replies

2. UNIX for Advanced & Expert Users

gzip vs pipe gzip: produce different file size

Hi All, I have a random test file: test.txt, size: 146 $ ll test.txt $ 146 test.txt Take 1: $ cat test.txt | gzip > test.txt.gz $ ll test.txt.gz $ 124 test.txt.gz Take 2: $ gzip test.txt $ ll test.txt.gz $ 133 test.txt.gz As you can see, gzipping a file and piping into gzip... (1 Reply)
Discussion started by: hanfresco
1 Replies

3. Red Hat

how to produce date command o/p

Hello I am trying of a solution to produce date cmnd o/p as: Feb 18 is the 049 day of the year. Any ideas how to produce this? (2 Replies)
Discussion started by: ranumala
2 Replies

4. Shell Programming and Scripting

get file content and produce command

hi buddies; ip.txt: 192.168.1.1 192.168.1.2 192.168.1.3 192.168.1.4 192.168.1.5 ... parameters.txt: portvalue username password session ... (2 Replies)
Discussion started by: gc_sw
2 Replies

5. Shell Programming and Scripting

Shell script that will compare two config files and produce 2 outputs 1)actual config file 2)report

Hi I am new to shell scripting. There is a requirement to write a shell script to meet follwing needs.Prompt reply shall be highly appreciated. script that will compare two config files and produce 2 outputs - actual config file and a report indicating changes made. OS :Susi linux ver 10.3. ... (4 Replies)
Discussion started by: muraliinfy04
4 Replies

6. Shell Programming and Scripting

simple join for multiple files and produce 3 outputs

sh script file1 filea fileb filec ................filez. >>output1 & output2 &output3 file1 z10 1873 1920 z_number1_E59 z10 2042 2090 z_number2_E59 Z22 2476 2560 z_number3_E59 Z22 2838 2915 z_number4_E59 z1 1873 1920 z_number1_E60 z1 ... (9 Replies)
Discussion started by: stateperl
9 Replies

7. Shell Programming and Scripting

awk to produce zip commands

Hi, I have a list of files which I want to rename and zipped up. The zip file will be split into small files when it contains 500 renamed file. Currently the way i am doing is like this. Get the filenames of the files in a list Generate another list containing the target filenames... (0 Replies)
Discussion started by: Leion
0 Replies

8. Shell Programming and Scripting

Perl Script to produce a file

hi i got a file called essay which contain few pages with many paragraphs. now i wanna with PERL to produce another file which called Essaylist that contain a sorted list of words that appear in the file essay. the format for Essaylist: $word found $times times on page a b c.... where $word... (3 Replies)
Discussion started by: mingming88
3 Replies

9. Shell Programming and Scripting

Adding things in a file and produce a new one

I wanna add a ":" at the end of each line, and i did something like this: cat Totals | while read ID TOTAL do echo "${ID}:${TOTAL}:" >>Totals2 done File: Totals 12345678:13 21443433:20 The outputs file Totals2 is: 12345678:13:: 21443433:20:: but i want 12345678:13:... (3 Replies)
Discussion started by: mingming88
3 Replies

10. Shell Programming and Scripting

awk NR==FNR compare 2 files produce a 3rd

hi, i have two files, both with 3 columns, the 3rd column has common values between the two files and i want to produce a 3rd file with 4 columns. file 1 a, ,b c file 2 a, b ,d I want to compare the 3rd value and if a match print to file 3 with the 3 columns from the first file... (11 Replies)
Discussion started by: borderblaster
11 Replies
Login or Register to Ask a Question