comm command help with unicode chars in file


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting comm command help with unicode chars in file
# 8  
Old 07-06-2010
Code:
grep -v a2 a1

this shud get u going..

u can use ur master and bad sector file and get the good records

Code:
lets say
master file = m, bad record=b
cat m > result
cat b >> result
uniq -u result

this will only give u good results.
Code:
-u Displays only lines not duplicated (uniq lines).

# 9  
Old 07-06-2010
Assuming each record is unique and that the output order does not matter:

Code:
cat file.txt bad.txt | sort |uniq -u



Or sort each file before the "comm".
Code:
cat file.txt | sort >file.sor
cat bad.txt  | sort >bad.sor
comm -23 file.sor bad.sor


Last edited by methyl; 07-06-2010 at 11:06 AM..
# 10  
Old 07-06-2010
Quote:
Originally Posted by dazdseg
Code:
grep -v a2 a1

This should get you going..

You can use your master and bad sector file and get the good records.

...

This will only give you good results.
There, now you know the real words.
# 11  
Old 07-06-2010
@corona :Thats what dazdseg told rite.. Did you add anything to it...

Last edited by ashwin3086; 07-06-2010 at 11:24 AM.. Reason: changed
# 12  
Old 07-06-2010
thanks for letting me know.
# 13  
Old 07-06-2010
Please don't use 'l33t sp33k' - this isn't twitter. Plain English. If English is a problem for you we have translation services. That is what corona is telling you.
# 14  
Old 07-06-2010
Hi, dazdseg.
Quote:
Originally Posted by dazdseg
Code:
grep -v a2 a1

this shud get u going..

u can use ur master and bad sector file and get the good records

Code:
lets say
master file = m, bad record=b
cat m > result
cat b >> result
uniq -u result

this will only give u good results.
Code:
-u Displays only lines not duplicated (uniq lines).

However:
Quote:
Note: 'uniq' does not detect repeated lines unless they are adjacent.
You may want to sort the input first, or use `sort -u' without `uniq'.
-- excerpt from man uniq
cheers, drl
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Need help regarding formatting(comm -23 command)

Hello all , I have two files a.txt and b.txt which have same content . They contain data that is fetched from database through a java program. When I delete a line in a.txt and run the below command comm -13 a.txt b.txt I am not getting the expected result i.e. the line i deleted from... (5 Replies)
Discussion started by: RaviTej
5 Replies

2. Linux

comm command help

The manual does not cover this very well. What do the following compares will do ? 1) comm -13 file1 file2: will it display what is in file2 not in file1? 2) comm -23 file1 file2: will it display what in 1 but not in 2 ? Thanks (5 Replies)
Discussion started by: mrn6430
5 Replies

3. UNIX for Dummies Questions & Answers

Need help with comm command

Hello , I am trying to get contents which are only present in a.csv ,so using comm -23 cat a.csv | sort > a.csv cat b.csv | sort > b.csv comm -23 a.csv b.csv > c.csv. a.csv SKU COUNTRY CURRENCY PRICE_LIST_TYPE LIST_PRICE_EFFECTIVE_DATE TG430ZA ZA USD DF ... (4 Replies)
Discussion started by: RaviTej
4 Replies

4. UNIX for Dummies Questions & Answers

Remove Unicode/special chars from XML

Hi, We are receiving an XML file in Unix which has some special characters between tags like '^' etc <Tag> 1e^O7f%<2304e.$d8f57e8^Bf-&e.^Zh7/327e^O7 </Tag> We need to remove all special characters like ^ ones and also any '&' or '<' or '>' being sent within the start and close tags i.e.... (6 Replies)
Discussion started by: dsrookie7
6 Replies

5. UNIX for Dummies Questions & Answers

help on COMM command please

could some one please explain with examples how comm -12 & comm -3 works. I am confused with manual page, Thankyou. (2 Replies)
Discussion started by: Ariean
2 Replies

6. UNIX for Dummies Questions & Answers

Several file comparison not uniq or comm command

When comparing several files is there a way to find values unique to each file? File1 a b c d File2 a b t File 3 a (3 Replies)
Discussion started by: dr_sabz
3 Replies

7. Shell Programming and Scripting

finding files with unicode chars in the filename

I'm trying to check-in a repository to svn -- but the import is failing because some files waaaay down deep in some graphics-library folder are using unicode characters in the file name - which are masked using the ls command but picked up when piping output to more: # ls -l 1914* -rwxrwxr-x 1... (2 Replies)
Discussion started by: mshallop
2 Replies

8. UNIX for Dummies Questions & Answers

help in comm command

Hi all, I need help in comm command , I am having 2 files . I have to display the common line in the two file only onnce and i have to also display the non common line as well. tmpcut1 -- First file cat tmpcut1 smstr_303000_O_432830_... f_c2_queue_sys30.sys30 RUNNING 10 1000... (1 Reply)
Discussion started by: arunkumar_mca
1 Replies

9. Shell Programming and Scripting

comm command

Hi I have issue with "comm " command file-1 ---- l65059 l65407 l68607 l68810 l69143 l71310 l72918 l73146 l73273 l76411 file-2 ----- (8 Replies)
Discussion started by: amitrajvarma
8 Replies

10. UNIX for Dummies Questions & Answers

Comm, command help

See my other post on sdiff .... I don't think sdiff is able to do what I want. The 'comm' command does what I need and works fine as far as the logic and results. The problem I'm having is with the output format, it outputs 3 columns of data, but because of the way it starts each line... (2 Replies)
Discussion started by: cowpoke
2 Replies
Login or Register to Ask a Question