-1

I´m trying to convert this sentence: setNull( this.isEx.dif_A_B) wich is a powerbuilder method into this.isEx.dif_A_B = 0 the equivalent in java.

I have tried to use gensub with the following regex:

line = gensub(/setNull[(][ \t]?(\w|\.)*[ \t]?[)]/, " \\1 = 0 " , "g", line);

but the output is B=0

I dont get it why he only catches the last letter.

How i can solve this?

Thanks

2 Answers2

0

You can just use ( or ) or space as the field delimiter and then pick field 3:

awk -F'[() ]' '{printf "%s = 0\n", $3}' input.file
hek2mgl
  • 152,036
  • 28
  • 249
  • 266
0

Thanks for the answers, but is already solved,the asterisk is missing in front o "w".

linha =  gensub(/setNull\(( |\t)*(\w*|\.)*( |\t)*\)/, " \\2 = 0 " , "g", linha)