10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
HI!!
I am trying to compare two files using AWK but I have some problems. I need to count how many times letters are used in two texts. This is my script
{
long=length($0)
for (i=1;i<=long;i++)
{
aux=substr($0,i,1)
if ( aux != " " && aux != "" )
... (7 Replies)
Discussion started by: ettore8888
7 Replies
2. Shell Programming and Scripting
I have a below requirement and trying to compare the files using awk
File 1 - Already stored on a prev day
id | text | email id
---------------------------------
89564|this is line 1 | xyz@sample.txt
985384|this is line 2 | abc@sample.txt
657342|this is line 3 |... (3 Replies)
Discussion started by: rakesh_411
3 Replies
3. Shell Programming and Scripting
Hi,
I have a situation to compare one file, say file1.txt with a set of files in directory.The directory contains more than 100 files.
To be more precise, the requirement is to compare the first field of file1.txt with the first field in all the files in the directory.The files in the... (10 Replies)
Discussion started by: anandek
10 Replies
4. UNIX for Dummies Questions & Answers
Hi,
I'm a newbie to scripting and am trying to compare two files using awk.
The files are exactly the same dimensions. Where the first file has 0's I would like to create an updated version of the second file which has the corresponding elements set to zero also.
eg:
file1:
12345 1 2 0... (3 Replies)
Discussion started by: kasan0
3 Replies
5. Shell Programming and Scripting
Hello,
I am strugling from quite a some time to compare flat files with over 1 million records could anyone please help me.
I want to compare two pipe delimited flat files, file1 with file2 and output the unmatched rows from file2 in file3
Sample File1:
... (9 Replies)
Discussion started by: suhaeb
9 Replies
6. UNIX for Dummies Questions & Answers
Hi
How can I use awk to compare specific columns in 2 files and print the difference.
I currently have this:
BEGIN {
OFS = FS = ","
}
NR == FNR {
b = $3
next
}
{
e = ""
for (x in b) {
if (match ($1, x)) {
if (RSTART == 1 && RLENGTH > length(e)) {
e=x (2 Replies)
Discussion started by: ladyAnne
2 Replies
7. Shell Programming and Scripting
Hi Frnds,
I have a flat file with millions of records. .
Now I on this. (I prefer for AWK as its gives good performance.)
Old_file.txt
------------------
1 gopi ase ....
2 arun pl ...
3 jack sutha ..
4 peter pm ..
...
New_file.txt
---------------
4 peter pm ..
..
... (12 Replies)
Discussion started by: Gopal_Engg
12 Replies
8. Shell Programming and Scripting
Hi Gurus,
I searched the forum but didnt get much info.
I want to compare 2 files.
1)Newfile comes today with
2)Old file of previous day.
The files are same ,just the new files might have new records sometimes.
So I want to capture these new records in another file.
Can anyone help... (5 Replies)
Discussion started by: ganesh123
5 Replies
9. Shell Programming and Scripting
Hi,
I need to compare two flat files (yesterday & today's data) and get only the changed data from flat files. In flat file i dont have data column or anything its just a string data in flat file.Can any one please let me know the script
With Regds
Shashi (3 Replies)
Discussion started by: jtshashidhar
3 Replies
10. Shell Programming and Scripting
Hi All,
I am giving an example similar to the problem I have.
I have two data files of 10 columns each in which fields are delimited by comma(,). I need to compare compare the two files using the uniq col(col3). If there are any records in file1 and are not in file2 then I have check the value... (3 Replies)
Discussion started by: rajus19
3 Replies