Sponsored Content
Top Forums Shell Programming and Scripting Comapring files charecter by charecter using AWK/Shell Script Post 302135752 by radoulov on Wednesday 12th of September 2007 05:44:38 AM
Old 09-12-2007
With diff you get line positions:

Code:
$ cat file1
2007/08/19 09:48:10 DH-032 $APTA1: Device AATD8029
2007/08/19 09:48:10 DH-045 $APTA1: Device AATD8029
2007/08/19 09:48:10 DH-043 $APTA1: Device AATD8029 
$ cat file2
2007-08-19 09:48:10  DH-032 $APTA1: Device AATD8029
2007-08-19 09:48:10  DH-043 $APTA1: Device AATD8029
2007-08-19 09:48:10  DH-045 $APTA1: Device AATD8029 
$ diff -b <(tr '/' '-'<file1) file2
2d1
< 2007-08-19 09:48:10 DH-045 $APTA1: Device AATD8029
3a3
> 2007-08-19 09:48:10  DH-045 $APTA1: Device AATD8029

 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

cutting columns if delimiter has more than one charecter

Hi, My file looks like abc$%sdfhs$%sdf$%sdfaf$% here as seen delimiter is $%...now how cas i take out second field as cut command expect delimiter as single charecter only.....is there is any other way thanks and regards mahabunta (9 Replies)
Discussion started by: mahabunta
9 Replies

2. Shell Programming and Scripting

cut First charecter in any string

I wannt to cut first char of any string. str=A2465443 out put will be. str1=A str2=2465443. I tried str2=${?%srt} str1=${str#$str2} it is not working. (6 Replies)
Discussion started by: rinku
6 Replies

3. Shell Programming and Scripting

find charecter from its ascii value.

how could find charecter from its ascii value. please suggest me any code for that. thannks in advance. (2 Replies)
Discussion started by: rinku
2 Replies

4. UNIX for Dummies Questions & Answers

charecter or number

Hi Friends, How to check a variable value is either charecter or number? With Regards / Ganapati (1 Reply)
Discussion started by: ganapati
1 Replies

5. Shell Programming and Scripting

Delete last charecter of each line.

Hi, I have file which is having the following content. 11082202^M 10951265^M 11482003^M 12820986^M 11309561^M 11092815^M 11103308^M 13024722^M 11343958^M 11280355^M 7516723^M i want to delete the last charecter "^M" from all the line and redirect to other line. Please help... (1 Reply)
Discussion started by: shivanete
1 Replies

6. Shell Programming and Scripting

to delete charecter in a line

Hi, Using perl, how can I delete a charecter (specify the position number), in a line which starts with "GETR P" and another line starting with "GET P:=". This needs tro be done for many charecters in a line Thanks Vijayalakshmi (2 Replies)
Discussion started by: abc_81
2 Replies

7. UNIX for Dummies Questions & Answers

cutting columns if delimiter has more than one charecter (|^)

Hi All, I am having a file with the delimiter '|^'. File name:test_dlim.csv I want to cut the first field of this using awk command. I tried with the help of the following link:... (2 Replies)
Discussion started by: boopathyvasagam
2 Replies

8. Shell Programming and Scripting

Need special charecter in email body

I have a unix shell script generate.sh that writes to a file hello.txt using redirect. For example:echo " Today's report shows progress by: " > hello.txt This hello.txt is then send as an email body to the recipients. My requirement is to have this special characters(up arrow and down arrow... (6 Replies)
Discussion started by: mohtashims
6 Replies

9. Shell Programming and Scripting

If condition fails for special charecter

I have a sample server name listed in variable as below: var="server-13" I need to check if the 7th character on $var is number 1 whichenv=`echo "$var"| head -c 7 | tail -c 1` if ]; then echo "9 found" else echo "9 Not Found" fi Output: This works... (3 Replies)
Discussion started by: mohtashims
3 Replies

10. UNIX for Beginners Questions & Answers

Simple question about charecter count

Hi, I have collection of letters in a column such as: AA5678 AA9873434 .. .. I am trying to find the number of charecters in each. "echo "AA5678"|wc -c 7----------------> why does it give 7 instead of 6? (6 Replies)
Discussion started by: kvosu
6 Replies
XZDIFF(1)							     XZ Utils								 XZDIFF(1)

NAME
xzcmp, xzdiff, lzcmp, lzdiff - compare compressed files SYNOPSIS
xzcmp [cmp_options] file1 [file2] xzdiff [diff_options] file1 [file2] lzcmp [cmp_options] file1 [file2] lzdiff [diff_options] file1 [file2] DESCRIPTION
xzcmp and xdiff invoke cmp(1) or diff(1) on files compressed with xz(1), lzma(1), gzip(1), or bzip2(1). All options specified are passed directly to cmp or diff. If only one file is specified, then the files compared are file1 (which must have a suffix of a supported com- pression format) and file1 from which the compression format suffix has been stripped. If two files are specified, then they are uncom- pressed if necessary and fed to cmp(1) or diff(1). The exit status from cmp or diff is preserved. The names lzcmp and lzdiff are provided for backward compatibility with LZMA Utils. SEE ALSO
cmp(1), diff(1), xz(1), gzip(1), bzip2(1), zdiff(1) BUGS
Messages from the cmp(1) or diff(1) programs refer to temporary filenames instead of those specified. Tukaani 2009-07-05 XZDIFF(1)
All times are GMT -4. The time now is 04:54 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy