English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

if we know the line number, column number, in a file xxx
how to get the letter in that particular position?
pls give me the instructions,

ex,
----------------------------------------------------------
ABCDEFGHIJKLMNOPQRSTUVWXYZ
abcdefghijklmnopqrstuvwxyz
01234567890
-----------------------------------------------------------
here the inputs for the script is row and column number,
if input is (1, 8), then script should return, H

2007-03-20 04:16:38 · 2 answers · asked by sekhar 1 in Computers & Internet Programming & Design

2 answers

you could slurp the entire file into an array like @lines = <> then call substr on the line you want

2007-03-20 04:23:44 · answer #1 · answered by undercoloteal 3 · 0 0

I don't write Perl scripts, I write Perl programs.

open the file
use a for loop to read R lines
use substr to grab the C letter

2007-03-20 17:27:42 · answer #2 · answered by martinthurn 6 · 0 0

fedest.com, questions and answers