in reply to Re: Why this script is not running on windows?
in thread Why this script is not running on windows?

Hey Hauke how are you?

This code also seems fine.. I want to ask you another question as I could not find a way to do it in my one liner.

This Script takes on a input file like:

NP_416485.4: 970-970, 991-992, 1126-1235 NP_417679.2: 209-413, 418-421, 441-542

and gives a output like:

NP_416485.4: 1126-1235 NP_417679.2: 209-413 441-542

But instead of only <space> in output, I want a output like the input format.. i.e.,comma then space:

NP_416485.4: 1126-1235 NP_417679.2: 209-413, 441-542

Thanks

Replies are listed 'Best First'.
Re^3: Why this script is not running on windows?
by haukex (Archbishop) on Nov 01, 2016 at 11:12 UTC

    Hi abhikalrt53,

    One way to do this would be to store the ranges in an array, and then use join when outputting the array.

    A simpler way to do it would be to add the comma only under certain conditions, i.e. $s .= ',' if ...; - I'm not going to give away the condition because I don't think it's appropriate I do all of your (home)work for you ;-)

    Hope this helps,
    -- Hauke D

      thank u sir