I
I
Iqbol2017-06-12 15:10:07
.NET
Iqbol, 2017-06-12 15:10:07

How to parse log file in C# and write data to database?

Good afternoon.
Please tell me how to correctly parse the log file with the following structure:
Jun 5 04:49:08 192.168.1.1 : %SNMP-3-INPUT_QFULL_ERR: Packet dropped due to input
That is, you need to split it into 5 columns, since the data there is different.
Thanks in advance !

Answer the question

In order to leave comments, you need to log in

3 answer(s)
D
Denis Michurin, 2017-06-12
@denistu10

And if there is a gap, then somehow you have to pervert.

Don't have to split(' ')

T
Therapyx, 2017-06-12
@Therapyx

how different can they be? If the structure is always the same, I would do something similar with a java stringtokenizer. https://stackoverflow.com/questions/70405/does-cs...
or prescribe an appropriate rexex

K
Konstantin Tsvetkov, 2017-06-12
@tsklab

How to parse log file in C# and write data to database?
Usually this is already done for you - the DBMS delivery includes data import/export utilities.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question