Link to home
Start Free TrialLog in
Avatar of Skale
Skale

asked on

How to convert ascii file rows to class property in vb.net

Hi,

I'm trying to convert ascii(.txt) rows to as class property after that i'll write this informations to access database or compare two models.

An example ascii row format is like below; Also i wonder is it possible or not for example after two days i'll add new row and i'd like to keep this row also property?

BaseModel=AP361SCD.inp
ModifiedDate=10/08/2018
User=John Doe
Avatar of Éric Moreau
Éric Moreau
Flag of Canada image

The easy part of your question is to compare to objects. You need to write code. You need to override the Equals operator as shown in https://www.infoq.com/articles/Equality-Overloading-DotNET/

But before getting there, you will need to parse your file. It looks like it is a text file and that you have labels. You will need to read line-by-line and fill a class instance with the values before you call your overridden Equals operator.
Hi Hakan;

A little more information would be helpful. Such as, one row in the file has only one piece of information for example, User=John Doe? Or are there multiple info on one line in the file? Are the information in any order? What is the delimiter between multiple information belonging to different objects that belong to different classes? Do you have a list of properties that will belong to the class that you wish to fill?
ASKER CERTIFIED SOLUTION
Avatar of Rikin Shah
Rikin Shah
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial