Sponsored Content
Top Forums Shell Programming and Scripting need to print the missing lines in 1 file from 1 file via script Post 302426605 by dazdseg on Wednesday 2nd of June 2010 09:43:46 AM
Old 06-02-2010
i have done a lil bit of modification. i am not checking this for different directories. i have pasted both the files in same directory and doing it ... see the below script. (i m pasing my script as u said.. sorry for late response)

Code:
#!/usr/bin/ksh

echo  "enter the full name of the  first file:"
read f1
echo  "enter the full name of the  second file:"
read f2

for i in `find $f1 -prune -type f| xargs`
do
for j in `find $f2 -prune -type f | xargs `
do
A=`basename $i`
B=`basename $j`
if [ "$A" -eq "$B" ]
then
(comm $i $j|awk '{print $1,$2}'|uniq) > out.txt
#(cmp $i $j | awk '{print $1, $2}' | uniq ) >log.txt
fi
mv out.txt dodo.txt
done
done

i even tried using it with cmp but cudnt go anywhere.. i am getting the below error.

Code:
./do_it.ksh[14]: CAM.cfg: bad number
mv: out.txt: cannot access: No such file or directory

i am also pasting both the files i am using ..

Code:
file1  - CAM.cfg
[DS] - DOSE
vmsa3=DS101_DS|OMER101|3
vmsa3=DSA101_DS|OMER201|9
vmsa3=DSA102_DS|OMER301|12
vmsa3=DSA102_DS|OMER401|11

[DS2] - DOSE
vmsa4=DSA2_DS|OMER01|2
vmsa4=DSA2_DS|OMER02|3

[DSA300] - DOSE
vmsa4=DSA300_DS|OMER01|3
vmsa4=DSA300_DS|OMER02|4
vmsa4=DSA300_DS|OMER03|5
vmsa4=DSA300_DS|OMER05|7

[VAL0] - VALID
vmsa4=VAL0_DS|OMER01|3
m3vmsa4=VAL00_DS|OMER02|4
m3vmsa4=VAL00_DS|OMER04|6

[INT00] - INT
pps02=INT01_DS|OMER101|3
pps02=INT01_DS|OMER401|9
pps02=INT01_DS|OMER501|11

[VT1] - MAP
vmsa2=VT10_DS|OMER102|4
vmsa2=VT11_DS|OMER202|6
vmsa2=VT12_DS|OMER302|8
vmsa2=VT12_DS|OMER402|9
vmsa2=VT13_DS|OMER501|11
vmsa2=VT14_DS|OMER601|12

attaching my 2nd file ........

the 2nd file is RAM1
Code:
vmsa4=VAL0_DS|LOG_DB|1
vmsa4=VAL0_DS|MIN_DB|2
vmsa4=VAL0_DS|OMER01|3
vmsa4=VAL0_DS|OMER02|4
vmsa4=VAL0_DS|OMER03|5
vmsa4=VAL0_DS|OMER04|6
vmsa4=VAL0_DS|OMER90|90
vmsa3=DSA10_DS|LOG|1
vmsa3=DSA10_DS|MIN_DB|2
vmsa3=DSA10_DS|OMER101|3
vmsa3=DSA10_DS|OMER201|9
vmsa3=DSA10_DS|OMER301|12
vmsa3=DSA1_DS|OMER401|11
vmsa3=DSA10_DS|OMER4401|90
vmsa4=DSA2_DS|LOG|1
vmsa4=DSA2_DS|OMER01|2
vmsa4=DSA2_DS|OMER01|3
vmsa4=DSA30_DS|LOG_DB|1
vmsa4=DSA30_DS|MIN_DB|2
vmsa4=DSA30_DS|OMER01|3
vmsa4=DSA30_DS|OMER02|4
vmsa4=DSA30_DS|OMER03|5
vmsa4=DSA30_DS|OMER04|6
vmsa4=DSA30_DS|OMER05|7
vmsa4=DSA30_DS|OMER90|90
pps02=INT0_DS|LOG|1
pps02=INT0_DS|MIN|2

please let me know if there is anything i am missing in execution...
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Extracting lines present in one file but missing in another using Perl

Hey I have an input file containing a list of numbers like: U01120.CDS.1 D25328.CDS.1 X15573.CDS.1 K03515.CDS.1 L44140.CDS.10 U24183.CDS.1 M97347.CDS.1 U05259.CDS.1 And another input file containing results created on the basis of the above input: G6PT_HUMAN U01120.CDS.1 -1.9450 3.1706... (1 Reply)
Discussion started by: Banni
1 Replies

2. Shell Programming and Scripting

Strings from one file which exactly match to the 1st column of other file and then print lines.

Hi, I have two files. 1st file has 1 column (huge file containing ~19200000 lines) and 2nd file has 2 columns (small file containing ~6000 lines). ################################# huge_file.txt a a ab b ################################## small_file.txt a 1.5 b 2.5 ab ... (4 Replies)
Discussion started by: AshwaniSharma09
4 Replies

3. Shell Programming and Scripting

join based on line number when one file is missing lines

I have a file that contains 87 lines, each with a set of coordinates (x & y). This file looks like: 1 200.3 -0.3 2 201.7 -0.32 ... 87 200.2 -0.314 I have another file which contains data that was taken at certain of these 87 positions. i.e.: 37 125 42 175 86 142 where the first... (1 Reply)
Discussion started by: jackiev
1 Replies

4. UNIX for Dummies Questions & Answers

Compare 2 files print the lines of file 2 that contain a string from file 1

Hello I am a new unix user, and I have a work related task to compare 2 files and print all of the lines in file 2 that contain a string from file 1 Note: the fields are in different columns in the files. I suspect the is a good use for awk? Thanks for your time & help File 1 123 232 W343... (6 Replies)
Discussion started by: KevinRidley
6 Replies

5. Shell Programming and Scripting

File Comparison: Print Lines not present in another file

Hi, I have fileA.txt like this. B01B02 D0011718 B01B03 D0012540 B01B04 D0006145 B01B05 D0004815 B01B06 D0012069 B01B07 D0004064 B01B08 D0011988 B01B09 D0012071 B01B10 D0005596 B01B11 D0011351 B01B12 D0004814 B01C01 D0011804 I want to compare this against another file (fileB.txt)... (3 Replies)
Discussion started by: genehunter
3 Replies

6. UNIX for Dummies Questions & Answers

Adding missing lines in file

Dear all, I have a file with two columns - the first column is increasing every 50, the second column is just count (e.g. 5). However, when count is zero, no line is present. Sample: 1950 7 2000 14 2050 7 2100 13 2150 10 2200 9 2250 7 2300 8 2350 7... (1 Reply)
Discussion started by: TheTransporter
1 Replies

7. UNIX for Dummies Questions & Answers

Adding missing lines in file

Dear all, I have a file with two columns - the first column is increasing every 50, the second column is just count (e.g. 5). However, when count is zero, no line is present. Sample: How can I change the file so as to include lines with zero count? e.g. in the previous file to put... (4 Replies)
Discussion started by: TheTransporter
4 Replies

8. UNIX for Dummies Questions & Answers

Find the missing file and print

Hi , i will be getting 24 files for one day with a formate like 20131028_01 - 20131028_24 kind of ,i am trying to write a shell script to count the number of files and if the count is not equal to 24 print the missing files names for A in `seq 0 23`; do ls *20131024_`printf "%02d" $A`*;... (3 Replies)
Discussion started by: vikatakavi
3 Replies

9. Shell Programming and Scripting

Print Missing Header Name from File.

HI Guys, I have file A.txt ID,L1,L2,L3,L4 1A,2a,33a,44b,55c 2A,10a,14a,15b,16c File B.txt ID L1 L4 L5 Output:- ID,L1,L4,L5 (2 Replies)
Discussion started by: pareshkp
2 Replies

10. Shell Programming and Scripting

Script to search every file in a directory and print last few lines

Hi everyone, I need to write a script to search a directory, output the name of a file to an ouput file and print the last few lines of the files to the output file such that I would have something like this: FILE1: LINE LINE LINE FILE2: LINE LINE LINE FILE3: LINE LINE LINE... (2 Replies)
Discussion started by: mojoman
2 Replies
GLCULLFACE(3G)															    GLCULLFACE(3G)

NAME
glCullFace - specify whether front- or back-facing facets can be culled C SPECIFICATION
void glCullFace( GLenum mode ) PARAMETERS
mode Specifies whether front- or back-facing facets are candidates for culling. Symbolic constants GL_FRONT, GL_BACK, and GL_FRONT_AND_BACK are accepted. The initial value is GL_BACK. DESCRIPTION
glCullFace specifies whether front- or back-facing facets are culled (as specified by mode) when facet culling is enabled. Facet culling is initially disabled. To enable and disable facet culling, call the glEnable and glDisable commands with the argument GL_CULL_FACE. Facets include triangles, quadrilaterals, polygons, and rectangles. glFrontFace specifies which of the clockwise and counterclockwise facets are front-facing and back-facing. See glFrontFace. NOTES
If mode is GL_FRONT_AND_BACK, no facets are drawn, but other primitives such as points and lines are drawn. ERRORS
GL_INVALID_ENUM is generated if mode is not an accepted value. GL_INVALID_OPERATION is generated if glCullFace is executed between the execution of glBegin and the corresponding execution of glEnd. ASSOCIATED GETS
glIsEnabled with argument GL_CULL_FACE glGet with argument GL_CULL_FACE_MODE SEE ALSO
glEnable(3G), glFrontFace(3G) GLCULLFACE(3G)
All times are GMT -4. The time now is 06:56 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy