LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 43
Default Importing Text files w/o losing special characters

I need to import text files into Excel without losing special characters.
I've tried several methods, but each time Excel imports in the file, ignoring
those characters. The following is an example line, but what you can't see
are the 6 special characters which appear between the $$158 and the 1 8!

$$158 1 8 4.50 1.0000 0.8000 3.0010 1.5740

I know they are there, however since I opened the document using Word,
which displays them as a y with 2 dots above them.

My Excel VBA code needs to import these characters so that it doesn't get
lost when extracting the data using MID(,,,) function. The text file were
generated using old FORTRAN programs, and there are thousands of them...my
VBA routines need to access these files in order to modernize our system.

Examples of what I've tried (all of these ignore the y characters)

Workbooks.OpenText Filename:=fname, Origin:=437, _
StartRow:=1, dataType:=xlFixedWidth, FieldInfo:=Array(0, 2)

With ActiveSheet.QueryTables.Add(Connection:="TEXT;" & fname,
Destination:=Cells(2, Col))

Open FName For Input Access Read As #1
While Not EOF(1)
Line Input #1, WholeLine
Cells(RowNdx, ColNdx).Value = WholeLine
RowNdx = RowNdx + 1
Wend
Close #1

I would upload an example file showing the characters if someone tells me
how. I would also tell you what the characters are, again, if someone tells
me how.

Thanks,
Tony
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Extract all text without spaces and special characters Alfredo_CPA Excel Worksheet Functions 4 September 18th 08 11:39 PM
Excel Save As... text with special characters Brynturk Excel Discussion (Misc queries) 2 June 23rd 05 02:59 AM
REMOVE SPECIAL CHARACTERS FROM TEXT CELLS javila255 Excel Worksheet Functions 1 April 2nd 05 06:24 PM
Importing text files with mathematical characters The Beckster Excel Discussion (Misc queries) 1 March 2nd 05 12:56 PM
Convert text with special characters Ligaya Excel Programming 3 December 6th 04 01:53 PM


All times are GMT +1. The time now is 02:03 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"