How to Export Node set ID/Name in HyperView While Exporting Query Stress/Displacement Results
I am trying to Export stress results using the Query Option in Hyperview as a *.CSV/*.txt file.
I am using Node By set option to export my results. How to include Setname/Set ID in the CSV File.
Any script is available to include the Set ID/name
Here is the attached Image which I am looking for as a reference
Find more posts tagged with
Hi, srinivas rallabandi
Sorry for replying late. When you create a set of nodes in HyperView, you can export the set info using a text file in TXT format.
After you export the results obtained by Query, you can use a TCL script or Python script to match the information of the two files, and write the set name corresponding to the node id into the text file obtained by query.
I tried with awk and sed bash script unfortunately it was taking either column or CSV format as my file format in the file-1.txt is different than file-2.txt. As you see here it has to find a match on file-2.txt based on file-1.txt and assign value (SET N) to the file-2.txt.
Unfortunately, there is no common field/column between these two files
File-<span class="hljs-number">1.</span>txt ---------- SET <span class="hljs-number">6</span> = <span class="hljs-number">11032</span>,<span class="hljs-number">13639</span>,<span class="hljs-number">13984</span>,<span class="hljs-number">13992</span> SET <span class="hljs-number">7</span> = <span class="hljs-number">14000</span>,<span class="hljs-number">14008</span>,<span class="hljs-number">14016</span> File-<span class="hljs-number">2.</span>txt ---------- <span class="hljs-number">11032</span>, <span class="hljs-number">2.820E+02</span> <span class="hljs-number">13639</span>, <span class="hljs-number">2.490E+02</span> <span class="hljs-number">13984</span>, <span class="hljs-number">3.056E+02</span> <span class="hljs-number">13992</span>, <span class="hljs-number">3.172E+02</span> <span class="hljs-number">14000</span>, <span class="hljs-number">3.106E+02</span> <span class="hljs-number">14008</span>, <span class="hljs-number">2.819E+02</span> <span class="hljs-number">14016</span>, <span class="hljs-number">2.380E+02</span> Desired Output -------------- SET <span class="hljs-number">6</span>,<span class="hljs-number">11032</span>, <span class="hljs-number">2.820E+02</span> SET <span class="hljs-number">6</span>,<span class="hljs-number">13639</span>, <span class="hljs-number">2.490E+02</span> SET <span class="hljs-number">6</span>,<span class="hljs-number">13984</span>, <span class="hljs-number">3.056E+02</span> SET <span class="hljs-number">6</span>,<span class="hljs-number">13992</span>, <span class="hljs-number">3.172E+02</span> SET <span class="hljs-number">7</span>,<span class="hljs-number">14000</span>, <span class="hljs-number">3.106E+02</span> SET <span class="hljs-number">7</span>,<span class="hljs-number">14008</span>, <span class="hljs-number">2.819E+02</span> SET <span class="hljs-number">7</span>,<span class="hljs-number">14016</span>, <span class="hljs-number">2.380E+02</span>
I tried half by reading my second file (File-2.txt) as a dictionary
from openpyxl import load_workbook
wb = load_workbook("file-2.xlsx")
sheet1 = wb.worksheets[0]
list_dict=[]
dict={}
for row_value in range(1,sheet1.max_row+1):
dict.update({sheet1.cell(row=7,column=1).value:sheet1.cell(row=row_value, column=2).value})
list_dict.append(dict)
print(list_dict)
Now I need read file-1.txt , and create the output file by looking up the values in the dictionary
Hi, srinivas rallabandi
May I know the result file type in your question ?
If you are using optistruct, You can achieve this by writing scripts.