I am trying to make like an automation process of extracting information from the msinfo32.txt that is generated by msinfo32 but I am struggling a lot with the completion of this task, I hope that anybody of you can help me with this
Basically what I need is to extract the following information from the .txt file and convert it to a .csv for parsing:
OS Name
Version
Other OS Description
OS Manufacturer
System Name
System Model
System Type
Processor
Processor
Processor
Processor
BIOS Version/Date
SMBIOS
Windows Directory
System Directory
Boot Device
Locale
Username
Time Zone
Installed Physical Memory
Total Physical Memory
Available Physical Memory
Total Virtual Memory
Available Virtual Memory
1.Read the text file by assigning String, String_var=file.ReadLines("File_Path)
2.Use âGenerate Data Tableâ activity to generate datatable from string data.
Hi.
Use the Read Text File activity which will store your text into a string variable. Then, you can do a number of things with that.
â if you would like to convert the string to a data table for processing in your automation, then use the Generate Data Table activity.
â if you simply want to output your text to a CSV file, then you can use the Write Text File activity using a file extension .CSV. CSVs are text filesâŚ
Or you can Generate to a data table then use Write CSV, but itâs really not needed, to be honest (like I said, CSVs are text files).
What I am trying to do is just get certain lines from the .txt file
The .txt file can be obtained by going to msinfo32 (System Information) and then clicking on export
The lines that I am interested on are the ones I mention in the first post, this is all for parsing purporses
I am struggling since I am searching everywhere but I cannot find how to do for example the 1st step that @nimin mentions which is 1.Read the text file by assigning String, String_var=file.ReadLines("File_Path)
I am very new to all of this and I want to learn as much as I can, but this is eating my head right now sadly, for sure is a basic thing for you guys but I am struggling
You can do the same thing with the Read Text File activity.
The suggestion by nimin was some scripting, which is also an option but not required.
This will return an enumerable of all the lines of text; an enumerable is basically an array. System.IO.File.ReadLines("filepath.txt")
This will return all your text into one string. System.IO.File.ReadAllText("filepath.txt")
You can use both in an Assign activity. If you would like more help on using scripting, let us know.
However, you donât need to use scripting⌠Just use the Read Text File activity
Sorry for the delay in response. I mentioned the method âFile.ReadLinesâ instead of âReadAllTextâ by mistake. Apologies for the confusion and inconvenience caused to you. I hope your problem has been resolved by using âRead Text File Activityâ instead of âReadAllTextâ method. If you want to know more about âFile.ReadAllTextâ, please check this out.
Thanks @ClaytonM for your clarification at the right time.
Hello @nimin donât worry about the late reply I understand.
Unfortunately I am not being sucesfull at the task, I mean I can read the file, I can create the table, etc⌠But what I need exactly is being difficult to me.
This is what I am trying to do step by step:
1.- Open msinfo32 by going to the start menu and typing it, it will open the system information window
2.- Export the information to a .txt fille or .csv file (doesnât matter the extension)
3.- Now what I am trying to do in UiPath is to get ONLY the information that I posted on the first post into a new csv file for parsing
For me its being complicated to fulfill this task, I tried yesterday the whole day and today I am continuing with it, searching on methods, reading guides, etc, but still not sucesful
Best regards and thank you very much I really appreciate your help