Text mining and content categorization

Import Text in Excel into SAS

Accepted Solution Solved
Reply
Occasional Contributor
Posts: 5
Accepted Solution

Import Text in Excel into SAS

Hi all,

I am using Enterprise Miner 13.2 and I tried to import Excel file into the Text Import nodes, but encounter one issue. My excel has about 300 comments in different text boxes, but SAS does not recognize them as separate comments, but rather one giant comment. Due to this issue, I cannot run Text Cluster Node further down. Is there a way to import the excel sheet but have SAS recognize each text box as a separate comment? Please help!

Thanks in advance.

Capture.PNG


Accepted Solutions
Solution
‎06-19-2015 12:25 PM
Grand Advisor
Posts: 10,075

Re: Import Text in Excel into SAS

"Text boxes" are graphical objects, not data apparently.

This VBA code is supposed to loop over the boxes and convert it to cells.

I really don't do much VBA, so good luck. BTW what ever process was used to generate that data should probably reconsider the use of these boxes.

Option Explicit

Sub test()

    Dim r As Long
    Dim TxtBox As TextBox

    r = 1 'start in Row 1
   
    For Each TxtBox In ActiveSheet.TextBoxes
        Cells(r, "A").Value = TxtBox.Text
        TxtBox.Delete
        r = r + 1
    Next
   
End Sub

View solution in original post


All Replies
Grand Advisor
Posts: 10,075

Re: Import Text in Excel into SAS

First thing I try with any issue regarding Excel is to export to (file save as ) CSV and try that file.

Occasional Contributor
Posts: 5

Re: Import Text in Excel into SAS

I tried that, and it is still showing document of 1...

Solution
‎06-19-2015 12:25 PM
Grand Advisor
Posts: 10,075

Re: Import Text in Excel into SAS

"Text boxes" are graphical objects, not data apparently.

This VBA code is supposed to loop over the boxes and convert it to cells.

I really don't do much VBA, so good luck. BTW what ever process was used to generate that data should probably reconsider the use of these boxes.

Option Explicit

Sub test()

    Dim r As Long
    Dim TxtBox As TextBox

    r = 1 'start in Row 1
   
    For Each TxtBox In ActiveSheet.TextBoxes
        Cells(r, "A").Value = TxtBox.Text
        TxtBox.Delete
        r = r + 1
    Next
   
End Sub

Occasional Contributor
Posts: 5

Re: Import Text in Excel into SAS

I found the solution. Use File Import Node instead of Text Import node will allow SAS to see each individual lines as an separate comment rather than a block of comment.

☑ This topic is SOLVED.

Need further help from the community? Please ask a new question.

Discussion stats
  • 4 replies
  • 624 views
  • 3 likes
  • 2 in conversation