How do i delete the records when we have string "abcd" at position 21 to 24. The file is huge in size. Any help is appreciated.
Sample data given below
Thanks for your reply.
I thought a script which reads the file line by line then check for the string at particular position then if string found do the deletion could solve this problem.
i used
sed '/pattern/d' filename
but the string "abcd" occuring other than the position 21 to 24 are also deleted. I want to delete only if string "abcd" is available in said position.
If you want to match characters in a certain position with sed you have to create a basic regular expression that matches the desired number of characters at the start of the line followed by the characters you want in that certain position. Try: