Resolved Retrieve attribute information from c# text file

wakachi

New member
Joined
May 21, 2020
Messages
4
Programming Experience
Beginner
I have a file text including C# code like below extension of the file .txt

```
private static readonly TextConstant Text001 = new TextConstant(new int[]{01, 02}, new string[]{"Test01", "Test02"}

private static readonly TextConstant Text002 = new TextConstant(new int[]{01,03, 02}, new string[]{"Test001","Test03", "Test02"}
```

I want to lookup information for each variable in this file.


Output expected :
```
Text001.a(1) --> Value 01
Text001.a(2) --> Value 02
Text001.b(1) --> Value "Test01"
Text001.b(2) --> Value "Test02"

Text001.a(1) --> Value 01
Text001.a(2) --> Value 03
Text001.a(3) --> Value 02
Text001.b(1) --> Value "Test01"
Text001.b(2) --> Value "Test03"
Text001.b(3) --> Value "Test02"
```

Thanks.
 
I don't know how to do it...
I'm loading this file from an sql database that store c# code
I need to retrieve all this information for each line.
 
Start here : Retrieving Data Using a DataReader - ADO.NET

And explain this more :
I'm loading this file from an sql database that store c# code
Why does the database store C# code?

The help you may receive will only be as good as the effort you put into explaining what you're trying to do and why. If we don't understand what your task is, you will likely receive vague responses.
 
This is a Microsoft Database.
It store all information related to the application.
The file look like below.
2020-05-22_02-26-21.png


Like you see the file contain all translate for each TextConstant in the application

new int[] {1036, 1033} for language ID (ENU, FRA)
new String[] {..., ..} the translation corresponding each language

I need to get all those information in another application to check if all TextConstant are translate yes or no and to be able to translate into another language
For the translation i have already an application that generate a file that can be imported.

All that i need is to retrieve those information from the file.

The database contains more than 6000 files.
 
You're basically asking how to parse text in a specific format. I repeat, what have you done and where are you stuck? You are capable of researching how to parse text, learn the principles and then apply them to this specific case. Once you've done that, if you encounter a particular issue, that would be the time to ask a question about that issue. If you don't know how to do something, the first step is to learn how to do it, not to get someone else to do it for you. If you try and encounter issues, we're here to help you get past those issues. If you don't try, there's not a lot of incentive for us to either.
 
Back
Top Bottom