#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2013
    Posts
    1
    Rep Power
    0

    Get Changed Filed


    HI,
    I have two files and contains many Fields or columns with | (pipe) delimitor, wanted to compare both the files and get only unmatched perticular fields number.
    ex:
    first.txt


    1 | 2 | 3
    111 |abc| 230
    hbc | bb2 | cs
    second.txt

    1 | 2 | 3
    111 |abc |230
    abn | bb2 | fp

    Here the different data in two fileds(i.e abn, fp in second file), the thing is i want only those changed fields or column numbers
    The same scipt will be used for many files in my project so the field changes are happens any filed in the second file, so please provide the scipt or command with accurate result.
    output.txt
    1
    3

    Thanks.
  2. #2
  3. Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Sep 2006
    Posts
    844
    Rep Power
    387

    Cool


    Originally Posted by prawinmca
    . . . E t c . . ., wanted to compare both the files and get only unmatched perticular fields number.
    Try:
    Code:
    $ diff first.txt second.txt >output.txt

    Comments on this post

    • aitken325i agrees

IMN logo majestic logo threadwatch logo seochat tools logo