in reply to Displaying the column number when reading a file

++ the above, but a stray concern intrudes: what if OP is talking about "column number" in the sense widely used by folk looking at
xxx yyyyy zzzz 111 aaa bbbb ccccc 222
who declare, not without justification, that the "y"s and "b"s appear in column two; the numerals "1" in column 4 and the numbers "2" in column 5.

rsriram... this is a case where more precise language, or a sample of the dataset would help.

and, if this is indeed a comma or tab delimited text file, why ...count the tabs!