Six Stars

Read file.dat with tfileinputregex

Hi,

I would like to read file.dat with tfileInputRegex.

Here is a screenshot of the file:

Capture.PNG

So,I need to distinguish the parts of the file by the beginning of the word "LB" because each time there is an LB it is new data to extract and i need to retrieve three fields that are framed in red.

I tried these exprssions but I still get an error

"^LB"+
"([A-Z]\\.*)"+
"^([0-9]{8}T[0-9]{6}\\.[0-9]{3}Z)"+
"([0-9]*\\.[0-9]*)|(^-[0-9]*\\.[0-9]*)|[\\?]"

 

Thanks in advance.

Best regards.

  • Data Integration
2 REPLIES
Nine Stars TRF
Nine Stars

Re: Read file.dat with tfileinputregex

Your explaination is not very clear as you speak about 3 fields circled in red but there only 1 for lines starting with LB. Also, you don't say anything about other fields also circled in red.
I suggest you to give us the expected result based on this sample.

TRF
Six Stars

Re: Read file.dat with tfileinputregex

I try to be clear
The file.dat contains values from several sensors. I can distinguish the data of a sensor by the LB. When there is LB, it means a new sensor

I need to create 3 fields (name, value, date) to recover the fields of the sensors
-Name (which is the name of the sensor) is in the line that contains LB
 -value,date begen starts from the third line until the start of a new sensor (an anothor line with LB)

Knowing for value I can find negative values or "?" or simple value 

Here is the expected result:


t.PNG

My need is to create a pattern with regex to create this fields.

 

Thanks in advance.