Shell Script Field longer than 20 characters
Hi Guys,
I apologise if the Heading might be incomplete or misleading, but didnt know how to word it. I can do basic to intermediate shell scripting ( I think ) but I need some LQ help with this one. So I have a text file with about 10 000 lines. Each line containes a description of medical item. In certain cases the first 20 characters of the description is excactly the same. Code:
WHIN HUBER NEED G20X3/4"(19MM) What I want to achive is to output only the descriptions where the first 20 characters are the same to a different text file. For example, taken the Items above, WHIN HUBER NEEDLE wont be in the output file, because the first 20 characters are not the same. But WINGED INFUSION CONTINUO, WINGED INFUSION INTERMIT,WISE GUIDE CATHETER would be in the output file. Hope im making sense. Karel |
Quote:
|
Hmm. Not sure about the 16/20 thing. Are you looking for something like this?
Code:
sort textfile.txt | uniq --check-chars=20 --repeated Quote:
Or this? Code:
sort textfile.txt | uniq --check-chars=20 --repeated --all-repeated Quote:
|
Quote:
Thanx, That was what I was looking for. |
All times are GMT -5. The time now is 12:47 PM. |