किसी पाठ फ़ाइल से विशिष्ट डेटा निकालें और इसे एक्सेल में आयात करें


0

मेरे पास बहुत सारी जानकारी के साथ एक .txt फाइल है, लेकिन मुझे केवल मीन एब्सोल्यूट एरर और रूट मीन स्क्वॉयड एरर के नंबरों की जरूरत है । मैं कैसे संख्याओं को स्वचालित और निकाल सकता हूं और उन्हें एक एक्सेल तालिका में डाल सकता हूं।

किसी भी मदद का स्वागत है। कमांड लाइन, स्क्रिप्ट, जावा, रेगुलर एक्सप्रेशंस, पॉवर्सशेल ...
मैं विंडोज 8.1 का उपयोग कर रहा हूं

श्रवण मेरी .txt फ़ाइल का एक छोटा सा हिस्सा है:

#############################################################################################################
Recommendation Type: ClusterBasedRecommendation (Experiment 1) for User 1 based on 2 friends: 
     Friends: 9, 220
     Distance: normal
     distThreshold: 0.0 / support weight: 0.35 / relevance weight: 0.65
     Highest predicted rating: 0.87 / Lowest predicted rating: 0.0
     Mean Absolute Error: 0.1516666666666667 / Root Mean Squared Error: 0.1552149047825842
     Fetching friends: 16ms  / Computing distances: 0ms  / Filtering friends: 0ms  / Calculate Recommendations: 15ms  / Overall: 31ms 
    Kendall Tau : 
#############################################################################################################
#############################################################################################################
Recommendation Type: ClusterBasedRecommendation (Experiment 1) for User 2 based on 3 friends: 
     Friends: 22, 182, 310
     Distance: normal
     distThreshold: 0.0 / support weight: 0.35 / relevance weight: 0.65
     Highest predicted rating: 1.0 / Lowest predicted rating: 0.0
     Mean Absolute Error: 0.15166666666666664 / Root Mean Squared Error: 0.16581448804143878
     Fetching friends: 1ms  / Computing distances: 0ms  / Filtering friends: 0ms  / Calculate Recommendations: 0ms  / Overall: 1ms 
    Kendall Tau : 
#############################################################################################################
#############################################################################################################
Recommendation Type: ClusterBasedRecommendation (Experiment 1) for User 3 based on 2 friends: 
     Friends: 20, 98
     Distance: normal
     distThreshold: 0.0 / support weight: 0.35 / relevance weight: 0.65
     Highest predicted rating: 0.87 / Lowest predicted rating: 0.0
     Mean Absolute Error: 0.07 / Root Mean Squared Error: 0.07826237921249264
     Fetching friends: 0ms  / Computing distances: 0ms  / Filtering friends: 0ms  / Calculate Recommendations: 0ms  / Overall: 0ms 
    Kendall Tau : 
#############################################################################################################
#############################################################################################################

आपने पहले से क्या किया है? कहाँ रह गया।
रेस्टाफैरियन

आपको "अनुशंसा प्रकार" से डेटा के बगल में बस नंबर या नंबर चाहिए?
कामिल

1
ओह प्रिय, क्या बकवास सॉफ्टवेयर इस तरह उत्पादन का उत्पादन?
कामिल

@ कामिल यह एक जावा लिखित कार्यक्रम है।
Devid

जवाबों:


1

यहाँ एक VBA समाधान है।

निर्देश: अपने पाठ को कॉलम A में पेस्ट करें और इस VBA कोड को चलाएं।

Sub ParseData()

Dim counter As Long
counter = 2

For Each cell In Range("A1", Range("A1").SpecialCells(xlCellTypeLastCell))

    If Left(Trim(cell), 19) = "Mean Absolute Error" Then
        Cells(counter, 3) = Mid(cell, InStr(1, cell, ":") + 1, InStr(1, cell, "/") - InStr(1, cell, ":") - 1)

    End If

    If InStr(1, cell, "Root Mean Squared Error:") > 0 Then
        Cells(counter, 4) = (Mid(cell, InStr(1, cell, "Root Mean Squared Error:") + 25, 30))
    counter = counter + 1
    End If

Next

End Sub

चेतावनी: एक्सेल दशमलव सटीक सीमा के बारे में पता होना चाहिए, क्योंकि यह 11 दशमलव बिंदुओं के बाद इसे काट रहा है।


@Devid, यह काम किया?
पेट्र फेडोरोव

हाँ धन्यवाद। मैंने कई बार कोशिश करने के बाद यह काम किया।
देवीदिवस

2

यहां एक गैर-प्रोग्रामिंग समाधान है ... एक्सेल ऑटो-फिल्टर में टेक्स्ट को एक एकल कॉलम में पेस्ट करें - ऐसा टेक्स्ट जिसमें "मीन एब्सोल्यूट एरर" हो और चूंकि आप जिस नंबर की तलाश कर रहे हैं, वह उसी पंक्ति में है जिसे आप छोड़ देंगे। केवल उस जानकारी के साथ, जिसकी आपको आवश्यकता है, आप स्तंभ संख्या में कनवर्ट करने के लिए कॉलम विज़ार्ड में कनवर्ट पाठ का उपयोग कर सकते हैं ।

यह कई मैनुअल कदम उठाता है, लेकिन अगर आपको इस स्वचालित की आवश्यकता नहीं है, तो आपको एक या दो मिनट के भीतर किया जाना चाहिए।

हमारी साइट का प्रयोग करके, आप स्वीकार करते हैं कि आपने हमारी Cookie Policy और निजता नीति को पढ़ और समझा लिया है।
Licensed under cc by-sa 3.0 with attribution required.