Hi, I am reading through a text file and when I encounter a specific text, I need to report it in the screen along with the line number in which it is appearing. I say print $.. Is there a similar way with which I can display the column number of the instance? For example, I want to report the column and line number in which character '&' is appearing. The message has to be
Line xx Col xx: & found.
print "Line $. : & found\n";
prints the line number, similarly I need to print the column number too. Any suggestions?
In reply to Displaying the column number when reading a file by rsriram
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |