Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
KR KR is offline
external usenet poster
 
Posts: 121
Default Basic Q: Field/Array info when importing fixed-width text files

I recorded the following macro, which I need to be able to edit as needed to
deal with various text files.

Workbooks.OpenText Filename:= _
"C:\Documents and Settings\Me\Desktop\testdatafile1.txt", Origin:=437, _
StartRow:=1, DataType:=xlFixedWidth, FieldInfo:=Array(Array(0, 1), Array(22
_
, 1), Array(32, 1), Array(40, 1), Array(41, 1), Array(47, 1), Array(88, 1),
Array(129, 1), _
Array(139, 1)), TrailingMinusNumbers:=True

So here is my question; I've used arrays lots of times in my own code, but
I'm not clear on the array statements in the fieldinfo section. They all end
in 1, so does the first number correspond to the width of the field? Is
there any conditions under which the second number would be something
_other_ than 1?

My real purpose of importing these files is so that I can load the entire
page into an array, and compare values to another file, and append new
information where appropriate. Is there a better way, for example, a way to
just read an entire text file into a large array (or array of arrays)?

Also, since I will be working with many files, I see the "origin" in this
case is 437. Any idea what specifically this refers to, or can I omit this
arguement and still have it work? The files will have been created (most
likely) on a VAX machine and FTP'd to a network location for our use.

Thanks for the assistance and clarification,
Keith

--
The enclosed questions or comments are entirely mine and don't represent the
thoughts, views, or policy of my employer. Any errors or omissions are my
own.


Reply
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
Problem Importing Fixed Width Data [email protected] New Users to Excel 7 September 15th 06 01:42 AM
Changing fixed width (column break) defaults when importing text NaughtonNJ Excel Discussion (Misc queries) 1 May 3rd 06 06:13 PM
Importing file with fixed width, multi-line records danmcgov Excel Discussion (Misc queries) 7 March 20th 06 08:05 PM
Software to download Fixed Width Files create_share Excel Discussion (Misc queries) 1 December 31st 05 09:41 PM
Fixed Width - Opening Certain Fixed Width Files Jan[_8_] Excel Programming 2 December 30th 03 08:31 PM


All times are GMT +1. The time now is 11:09 AM.

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

About Us

"It's about Microsoft Excel"