Reputation: 65
I have a txt file with that is formatted like this:
xxxxxxxxx,xxx
with a few thousand lines.
I have this command right now to delete the special characters from the file
sed -i -e:a -e 's/[^0-9]\(.*,\)/\1/;ta' file.txt
instead of editing the actual file, is there a way to print out the line of text that each individual one lies on?
I only need to test the first 9 characters as every line has a comma in it. :)
Upvotes: 2
Views: 1435
Reputation: 203664
It SOUNDS like all you want is:
grep '[^[:alnum:]]' file
but without sample input/output we're just guessing.
Upvotes: 1