# Problem in Diff command...

**URL:** <https://community.unix.com/t/problem-in-diff-command/297028>\
**Category:** Shell Programming and Scripting\
**Created:** [October 12, 2011, 2:18am UTC](https://community.unix.com/t/problem-in-diff-command/297028 "2011-10-12T02:18:03Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![suresh01\_apk](https://community.unix.com/letter_avatar/suresh01_apk/32/6_449c533f586939b6e5f246632a46421f.png) [@suresh01\_apk](https://community.unix.com/u/suresh01_apk)\
**Post date:** [October 12, 2011, 2:18am UTC](https://community.unix.com/t/problem-in-diff-command/297028/1 "2011-10-12T02:18:03Z")

</div>

Hi All,

I havae 2 files like this  
File1.dat.tar.gz--- has

```nohighlight
+667866066123|20110506
+667866066866|20110405

```

File2.dat.tar.gz -----contains

```nohighlight
+447866066123|20110505
+447866066866|20110405

```

If I give

```nohighlight
Gzcat File1.dat.tar.gz | cut �d �|� �f 1 > out1.dat 
Gzcat File2.dat.tar.gz| cut �d �|� �f 1 > out2.dat

```

Now out.dat contains 3 rows

```nohighlight
/users/sur/file1.dat 
+667866066123
+667866066866

```

Out2.dat contains 3 rows

```nohighlight
File2.dat
+447866066123
+447866066866

```

```nohighlight
Diff out1.dat out2.dat

```

Then it says

```nohighlight
1c1
< /users/sures_p/file1.dat
---
File2.dat

```

It means the first line in those 2 files are the previous filenames.  
Either I have to ignore the first line from the 2 files when doing diff.

Any help is really appreciated.

---

<div class="post-metadata">

**Author:** ![ahamed101](https://community.unix.com/user_avatar/community.unix.com/ahamed101/32/1118_2.png) [@ahamed101](https://community.unix.com/u/ahamed101)\
**Post date:** [October 12, 2011, 2:31am UTC](https://community.unix.com/t/problem-in-diff-command/297028/2 "2011-10-12T02:31:03Z")

</div>

Not sure if they are just typos, you did a diff between out1.dat and out2.dat. You have pasted the output of out.dat and Out2.dat

what is the issue here?

--ahamed

---

<div class="post-metadata">

**Author:** ![suresh01\_apk](https://community.unix.com/letter_avatar/suresh01_apk/32/6_449c533f586939b6e5f246632a46421f.png) [@suresh01\_apk](https://community.unix.com/u/suresh01_apk)\
**Post date:** [October 12, 2011, 3:16am UTC](https://community.unix.com/t/problem-in-diff-command/297028/3 "2011-10-12T03:16:11Z")

</div>

Thanks for your reply ahamed.

In my two output files I am getting the source filenames in my target output files. Now, I need to load the data in target file without having source filenames. I tried a lot. But everytime I am getting source filename in my target output files.  
out.dat

```nohighlight
/users/sur/file1.dat 
+667866066123
+667866066866

```

Out2.dat

```nohighlight
File2.dat
+447866066123
+447866066866

```

Original output should be  
out.dat

```nohighlight
+667866066123
+667866066866

```

Out2.dat

```nohighlight
+447866066123
+447866066866

```

---

<div class="post-metadata">

**Author:** ![ahamed101](https://community.unix.com/user_avatar/community.unix.com/ahamed101/32/1118_2.png) [@ahamed101](https://community.unix.com/u/ahamed101)\
**Post date:** [October 12, 2011, 3:32am UTC](https://community.unix.com/t/problem-in-diff-command/297028/4 "2011-10-12T03:32:06Z")

</div>

```nohighlight
gzcat File1.dat.tar.gz | cut �d �|� �f 1 | sed '1d' > out1.dat 

```

--ahamed

---

<div class="post-metadata">

**Author:** ![suresh01\_apk](https://community.unix.com/letter_avatar/suresh01_apk/32/6_449c533f586939b6e5f246632a46421f.png) [@suresh01\_apk](https://community.unix.com/u/suresh01_apk)\
**Post date:** [October 12, 2011, 5:01am UTC](https://community.unix.com/t/problem-in-diff-command/297028/5 "2011-10-12T05:01:53Z")

</div>

I resolved my problem. Thanks ahamed.
