D
D
Dmitry Krapivin2018-07-10 21:17:14
Java
Dmitry Krapivin, 2018-07-10 21:17:14

What is this type of text processing called?

Hello everyone
Parsing received the following data from the text:
Example1: Ff 45 2807
Example2: sh 567 2807
Note: Ff is wind speed, sh-temperature, 45_value, 567-value, 2807-date 07/28/2018
What is the name of the method / procedure / processing which would allow me to transform and display correctly from such a form of data? I don't even know how to search...
Example: something worked. And output:
Wind speed 45, Date 2807

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexey Cheremisin, 2018-07-11
@leahch

I guess that positional . You have a clearly defined position in the string.

B
baimkin, 2018-07-11
@baimkin

Substitutions, I don’t know how in Java, in c# it will look something like this:

string primer1 = "Ff 45 2807"
string veter = primer1.Replace("Ff ", "Скорость ветра ");
veter = Regex.Replace(veter, @"(?<=Скорость\ ветра\ \d+)\s(?=\d+)", ", Дата ");

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question