|
|||||||
| Forums | Search Forums | Register | Forum Rules | Man Pages | Albums | FAQ | Members | Calendar | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
|
|
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Need help with comm command
Hello , I am trying to get contents which are only present in a.csv ,so using comm -23 Code:
cat a.csv | sort > a.csv cat b.csv | sort > b.csv comm -23 a.csv b.csv > c.csv. Code:
a.csv SKU COUNTRY CURRENCY PRICE_LIST_TYPE LIST_PRICE_EFFECTIVE_DATE TG430ZA ZA USD DF 2012-03-28 9999-12-31 120000 TG431ZA ZA USD DF 2012-03-28 9999-12-31 96000 TG432ZA ZA USD DF 2012-03-28 9999-12-31 1200 TG433ZA ZA USD DF 2012-03-28 9999-12-31 12000 Code:
b.csv SKU COUNTRY CURRENCY PRICE_LIST_TYPE LIST_PRICE_EFFECTIVE_DATE TG431ZA ZA USD DF 2012-03-28 9999-12-31 96000 TG432ZA ZA USD DF 2012-03-28 9999-12-31 1200 TG433ZA ZA USD DF 2012-03-28 9999-12-31 12000 When I run the script , expected result is (2nd line of a.csv TG430ZA is not present in b.csv) Code:
TG430ZA ZA USD DF 2012-03-28 9999-12-31 120000 but I am getting Code:
SKU COUNTRY CURRENCY PRICE_LIST_TYPE LIST_PRICE_EFFECTIVE_DATE TG430ZA ZA USD DF 2012-03-28 9999-12-31 120000 Can any help me on this please. I have tried using comm -2 -3 also ..its same Last edited by methyl; 07-10-2012 at 06:38 AM.. Reason: Please use code tags. |
| Sponsored Links | ||
|
|
#2
|
|||
|
|||
|
There's probably some difference between the headers. Perhaps a carriage return, or an extra space or tab somewhere? Take a close look with od, hd, hexdump, or sed -n l.
Regards, Alister |
| Sponsored Links | ||
|
|
#3
|
|||
|
|||
|
I copied exact same line from a.csv into b.csv
SKU COUNTRY CURRENCY PRICE_LIST_TYPE LIST_PRICE_EFFECTIVE_DATE without any spacing errors , but output is same ... I do not understand why comm is unable to comprehend this line . Have been on this issue for a lot of time ![]() |
|
#4
|
|||
|
|||
|
Did you take a look at it with one of the tools I suggested? If not, do so. If you do not know how to interpret their output, post it here (and make sure to use code tags to preserve the formatting).
Regards, Alister |
| The Following User Says Thank You to alister For This Useful Post: | ||
RaviTej (07-09-2012) | ||
| Sponsored Links | |
|
|
#5
|
|||
|
|||
|
Hello alister ,
Thank you . I got the mistake , there is a blank space appended at the end of first line . Thanks a lot for the help . |
| Sponsored Links | ||
|
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| HPUX and comm command | guessingo | Shell Programming and Scripting | 3 | 05-02-2012 06:52 PM |
| help on COMM command please | Ariean | UNIX for Dummies Questions & Answers | 2 | 07-08-2010 01:05 PM |
| help in comm command | arunkumar_mca | UNIX for Dummies Questions & Answers | 1 | 04-27-2009 11:04 AM |
| comm command | amitrajvarma | Shell Programming and Scripting | 8 | 02-06-2008 04:20 AM |
| Comm, command help | cowpoke | UNIX for Dummies Questions & Answers | 2 | 10-25-2005 08:26 AM |
|
|