substr($string,0,2) will give you the first two digits
substr($string,5,1) will give you the sixth digit.



On Wed, Apr 9, 2008 at 3:27 PM, Michael Barnes <[EMAIL PROTECTED]> wrote:

> I have a list of strings like this:
>
> 060001_000
> 060001_001
> 060001_002
> 060001_003
> 060001_004
> 070002_000
> 070002_001
> 070002_002
> 070002_003
> 070002_004
>
> The position and value of the digits are significant.
>
> The first two digits give me a channel, i.e. 06=channel 1, 07= channel
> 2, etc.
>
> The sixth digit gives me the day of the week, i.e. 1=Monday, 2=Saturday,
> 4=Thursday, etc.
>
> The last two digits give me a time reference, i.e. 01=00:00:00,
> 02=00:30:00, 10=03:00:00, 11=03:30:00, etc.
>
> I pretty much know what to do with the value once I get it, but I can't
> figure out how to extract the digit by position.
>
> I have over 6,000 numbers in this list to pull data from and fill in a
> form.  I can fill in the form just fine with $strings.  I just have to
> get the right values in the $string.  It will take several monotonous
> weeks putting all this in by hand.
>
> Thanks,
> Michael
>
>
> --
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> http://learn.perl.org/
>
>
>


-- 
Jialin Li
832-618-3598

Reply via email to