Kiko Uehara wrote:
>
> I have a following data to analyze :
> ---------
>  BlockA
>         color 0 0 0
>         rcolor 1 1 1
>         dcolor 2 2 2
>
>  BloackB
>         color 0 0 0
>         rcolor 1 1 1
>         dcolor 2 2 2
> (...and so on)
> ---------
>
> I want to replace
>  BlockA rcolor "1 1 1" to "4 4 4"
>  and
>  BlockB rcolor "1 1 1" to "0 0 0".
>
> I have variables like $BlockA_rcolor = "rcolor 4 4 4".
>
> -------------
> while (<IN>)
> {
>     if ( $_ =~ m/rcolor/ )
>     {
> $_ = $BlockA_rcolor;
>     }
>     print $_;
> }
> -------------
>  Above code will replace all 'rcolor' lines in the data.
>
> Can anyone please give me an idea, what kind of method I could use ?
> If my question doesn't have enough information, please let me know.

Hi Kiko.

Your description is a mixture of data and code. If you want us to
look at your software then you need to post more than

> I have variables like $BlockA_rcolor = "rcolor 4 4 4".

But just from the identifiers in the data you have shown
it looks like you need to alter a set of RGB values in
a data file.

If you have a clearer description of your source and your
goal then we can help better. Are you changing a program
that already exists, or are you writing from scratch? It's
also usually better to show actual data if you can, rather
than something that you think encapsulates the real thing.

Rob



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to