AnsweredAssumed Answered

Is there a way to read new line and update fields in UFL?

Question asked by Guilherme Ferreira Champion on Nov 23, 2016
Latest reply on Nov 28, 2016 by Guilherme Ferreira

Hi all!

 

I am trying to read a RTF file with UFL interface. It doesn't have a specific standard like a csv to make it easier for the interface to find the data I want, but I think I am getting a way.

 

The portion of the data file I need Is like below and the only data I want is marked red:

{\f0\fs18 {\cf2 {\f3\fs23 \'93}}}\qc \cell\pard \intbl

{\f0\fs18 {\cf1 1}}\qc \cell\pard \intbl

{\f0\fs18 {\cf1 PUZOLANA 4 - 10 3d}}\qc \cell\pard \intbl

{\f0\fs18 {\cf1 2500.0}}\qc \cell\pard \intbl

{\f0\fs18 {\cf1 2.13}}\qc \cell\pard \intbl

{\f0\fs18 {\cf1 15.1}}\qc \cell\pard \intbl

{\f0\fs18 {\cf1 37.7}}\qc \cell\pard \intbl

{\f0\fs18 {\cf1 2186.1}}\qc \cell\pard \intbl

{\f0\fs18 {\cf1 15.1}}\qc \cell}\row

 

The pattern I am trying to implement is:

1- find {\f0\fs18 {\cf2

2- SkipLines(7)

3- read {\f0\fs18 {\cf* (*)}}

4- store in PI

 

What I've done so far is:

[MSG_1]

MSG_1.FILTER=C1=="*{\\f0\\fs18 {\\cf*}"

identifier=["*{\\f0\\fs18 {\\cf(*) *}*"]

result=["*{\\f0\\fs18 {\\cf* (*)}*"]

IF (identifier == 2) THEN

  SkipLines(7)

  //read this new line

   //update result

   //then store it in PI

  result=["*{\\f0\\fs18 {\\cf* (*)}*"]

  StoreInPI("TAG",,,result, , )

ENDIF

 

It is not working like that. How can I read a field after the skiplines?

If this approach is not possible, can I create an internal variable for flagging?

Something like:

 

[MSG_1]

MSG_1.FILTER=C1=="*{\\f0\\fs18 {\\cf*}"

identifier=["*{\\f0\\fs18 {\\cf(*) *}*"]

result=["*{\\f0\\fs18 {\\cf* (*)}*"]

flag = "FALSE"

IF (identifier == 2) THEN

   SkipLines(7)

   flag = "TRUE"

ELSE IF (flag == TRUE) THEN 

        StoreInPI("TAG",,,result, , )

         flag = "FALSE"

ENDIF

ENDIF

 

Regards

Outcomes