Default Import Multiple Arabic .TXT Files to Excel One Per Row???

joa762

New member
Joined
Feb 15, 2013
Messages
1
Reaction score
0
Points
0
Hi All,

First off I'd like to say it's awesome joining such a knowledgeable board.

I'm doing some basic Arabic text manipulation, but before I begin I have to input all the text files in a sub-folder on my OSX desktop to a single column in Excel, one file per cell in the column (i.e. .txt1 = A1; .txt2 = A2; .txt3 = A3).

Before I started I had to convert the document encoding from UTF8, to UTF16 so Arabic characters were properly rendered (I used UTFCast Pro -awesome for these kind of batch encoding conversions).

I have essentially zero VBA knowledge. I've got a recorded macro, but I need one that will loop through the entire sub-directory and print each txt file to each cell in column A:

Code:
Sub txtimp()
'
' txtimp Macro
'

'
    With ActiveSheet.QueryTables.Add(Connection:= _
        "TEXT;Macintosh HD:Users:joa:Desktop:MuradUTF16:murad (Converted) (2):muradout0037.txt" _
        , Destination:=Range("F1"))
        .Name = "muradout0037_3"
        .FieldNames = True
        .RowNumbers = False
        .FillAdjacentFormulas = False
        .RefreshOnFileOpen = False
        .BackgroundQuery = True
        .RefreshStyle = xlInsertDeleteCells
        .SavePassword = False
        .SaveData = True
        .AdjustColumnWidth = True
        .TextFilePromptOnRefresh = False
        .TextFilePlatform = xlMacintosh
        .TextFileStartRow = 1
        .TextFileParseType = xlDelimited
        .TextFileTextQualifier = xlTextQualifierDoubleQuote
        .TextFileConsecutiveDelimiter = False
        .TextFileTabDelimiter = True
        .TextFileSemicolonDelimiter = False
        .TextFileCommaDelimiter = False
        .TextFileSpaceDelimiter = False
        .TextFileColumnDataTypes = Array(1)
        .Refresh BackgroundQuery:=False
        .UseListObject = False
    End With
End Sub

Any suggestions??? I'm at an impasse and would greatly, greatly appreciate any assistance. M0037 is the first file in the folder, which proceed in ascending numeric order.

Thanks so much!!!
 
Back
Top