#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2009
    Posts
    1
    Rep Power
    0

    Help in perl script


    Dear all,

    I am a beginner using perl; scripting, so i wish you cna help me...

    I have a file containing a data like this:

    >CHA 2
    #419150.000000
    [4639567,4639674] [4825157,4825264] 7196
    [4639511,4639565] [4825101,4825155] 8416
    #1346.000000
    [4612526,4612558] [859583,859615] 1843
    [4612489,4612510] [859547,859568] 17296
    #1263.000000
    [4612623,4612644] [3296095,3296116] 18439
    [4612483,4612515] [3296057,3296089] 4517

    this data is transfered to an array, so each line in 1 element of this array (@data)

    I want a code that extract the first no. in the first square bracket in each line in @arr1(4639567,4639511,... for example).

    Thank you in advance
  2. #2
  3. !~ /m$/
    Devshed Specialist (4000 - 4499 posts)

    Join Date
    May 2004
    Location
    Reno, NV
    Posts
    4,265
    Rep Power
    1810
    Why did you transfer the file to an array? Why not just read the file line by line?

IMN logo majestic logo threadwatch logo seochat tools logo