Good afternoon,
I'm struggling with a validation issue on Outsystems 10.
In my app, I get information from an FTP location in TXT format. The text has several lines of text, example:
DULLES INTERNATIONAL AIRPORT, VA, United States (KIAD) 38-56N 077-27W 93M Feb 24, 2017 - 06:52 PM EST / 2017.02.24 2352 UTC Wind: from the SSE (160 degrees) at 10 MPH (9 KT):0 Visibility: 10 mile(s):0 Sky conditions: partly cloudy Temperature: 69.1 F (20.6 C) Dew Point: 50.0 F (10.0 C) Relative Humidity: 50% Pressure (altimeter): 29.79 in. Hg (1008 hPa) Pressure tendency: 0.01 inches (0.5 hPa) lower than three hours ago ob: KIAD 242352Z 16009KT 10SM SCT250 21/10 A2979 RMK AO2 SLP086 T02060100 10250 20206 55005 cycle: 0
I'am trying to put each line on one variable with the name of the field, ex: Temperature will get the text 69.1 F (20.6 C)
To do that, I try to get the index of the label as beginning and I am trying to get the linebreak index to use as string finale.
The problem is that I cannot get it to work with any usual validation, as per, \n \r\n newline() <br>.
any text that i use, i will get -1 as index.
Any idea to solve this issue?
Thanks,
Em
Hi,
You could try using the FileSystem extension. It has an action called "File_ReadTextLines" that returns a record list with all the lines in the file.
The only downside is that the action takes a file path as an input, so you're going to save to save the text to a file in the server. You can to that using that same extension's "File_WriteText" action.