Problems editing file with awk in bash script

Hello dear users, here I have a script to manipulate .csv files that are like this originally:

And I need to make a script to delete certain fields. Each field is separated with a comma.

So, here is my script (at least a part of it):

Field $1 is composed of a name, and then a "==$5-$12".
I need to delete that part. Is always like Txxx-Px_14_0_0==xxx-o6_0_0,26886_27498_7 and I need to delete Ex. ==xxx-o6_0_0,26886_27498_7 dynamically.

gsub works only for characters that don't change (or at least for me).
I tried making a variable for $5-$12 but it didn't work.

Can you help me please :o?

Post desired output for that sample line.

Something like this.

PS: Forgot to post that I'm using Solaris 10 and nawk, not awk (to use gsub). But I don't think it would change something.

Try:

perl -pe 's/==[^,]+,[^,]+//' $DOCUMENT >> "$DOCUMENT"final
1 Like

It seems that is working now. Many, MANY thanks from Argentina.

do you mean this?

awk 'BEGIN{FS="[=,]"}{printf $1",";for(i=5;i<=18;i++) printf "%s,",$i}' infile