perl + shell script + remove all not uniq lines except the first line uniq (FILE NAME) + perl in she
- by yael
hi I have the following file How to remove by sed all FILE NAME lines except the first uniq FILE NAME For example need to remove all FILE NAME lines from the file except the first:
FILE NAME: /dir1/dir2/dir3/dir4/dir5/file
FILE NAME: /dirA/dirB/dirC/dirD/dirE/file
the file:
FILE NAME: /dir1/dir2/dir3/dir4/dir5/file
PARAMETER NAME: blablabla
TARGET FILE: 12
SOURCE FILE: 565
FILE NAME: /dir1/dir2/dir3/dir4/dir5/file
PARAMETER NAME: blablabla
TARGET FILE: 18
SOURCE FILE: 552
FILE NAME: /dir1/dir2/dir3/dir4/dir5/file
PARAMETER NAME: blablabla
TARGET FILE: 14
SOURCE FILE: 559
FILE NAME: /dirA/dirB/dirC/dirD/dirE/file
PARAMETER NAME: blablabla
TARGET FILE: 134
SOURCE FILE: 344
FILE NAME: /dirA/dirB/dirC/dirD/dirE/file
PARAMETER NAME: blablabla
TARGET FILE: 13
SOURCE FILE: 445
FILE NAME: /dirA/dirB/dirC/dirD/dirE/file
PARAMETER NAME: blablabla
TARGET FILE: 13