Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
sbp sbp is offline
external usenet poster
 
Posts: 1
Default Importing CSV file (saved as Text) into XL as Text -- over 60 colu

I'm working on an OCR correction list that involves all the mistakes an OCR
app would make on a date: mm/dd/yy. That is, say, 01/01/06; O1/01/06,
Q1/01/06, etc. The list has to be in a format where fields are separated by
|, so I save as CSV, open in notepad and replace. The file is always saved
with a .txt extension so I can import into Excel as text. Word processing
programs don't have ability to show so many columns, hence the need for excel
when doing find and replace on the numbers.

However, when I need to add to it, Excel of course wants to see the dates as
dates and numbers as numbers -- that is, 01/01/06 is changed to 1/01/06, and
02101106 (where the OCR reads the / as 1) drops the leading zero. I can work
around this by importing the text file and selecting "TEXT" as the column
format. However, the import function is limited to about 64 columns. Beyond
that, I can't specify import as text, and it winds up importing columns
64-200 as general format (dropping the leading zero) and messing with dates.
How can I get Excel to import AS IS?
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default Importing CSV file (saved as Text) into XL as Text -- over 60 colu

I've never seen excel not be able to import more than 64 fields as text.

Maybe you could incorporate something like:

Dim myArray() As Variant
Dim iCtr As Long
Dim maxFields As Long

maxFields = 256 '256 columns maximum

ReDim myArray(1 To maxFields, 1 To 2)
For iCtr = 1 To maxFields
myArray(iCtr, 1) = iCtr
myArray(iCtr, 2) = 2
Next iCtr

Workbooks.OpenText Filename:="C:\somefilename.txt", Origin:=437, _
StartRow:=1, DataType:=xlDelimited, TextQualifier:=xlDoubleQuote, _
ConsecutiveDelimiter:=False, Tab:=False, Semicolon:=False, _
Comma:=False, _
Space:=False, Other:=True, OtherChar:="|", FieldInfo:=myArray

sbp wrote:

I'm working on an OCR correction list that involves all the mistakes an OCR
app would make on a date: mm/dd/yy. That is, say, 01/01/06; O1/01/06,
Q1/01/06, etc. The list has to be in a format where fields are separated by
|, so I save as CSV, open in notepad and replace. The file is always saved
with a .txt extension so I can import into Excel as text. Word processing
programs don't have ability to show so many columns, hence the need for excel
when doing find and replace on the numbers.

However, when I need to add to it, Excel of course wants to see the dates as
dates and numbers as numbers -- that is, 01/01/06 is changed to 1/01/06, and
02101106 (where the OCR reads the / as 1) drops the leading zero. I can work
around this by importing the text file and selecting "TEXT" as the column
format. However, the import function is limited to about 64 columns. Beyond
that, I can't specify import as text, and it winds up importing columns
64-200 as general format (dropping the leading zero) and messing with dates.
How can I get Excel to import AS IS?


--

Dave Peterson
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
Need Help Importing Text File Using Two or More Spaces as the Delimiter [email protected] Excel Discussion (Misc queries) 11 June 13th 06 02:08 AM
Can I automatically replace data when importing a text file? Jake New Users to Excel 1 June 6th 06 03:09 PM
disc full, saved to temp. file charlies Excel Discussion (Misc queries) 7 May 18th 06 08:40 PM
Exporting and Importing Named cells to and from a text file clayton Excel Discussion (Misc queries) 0 January 18th 06 08:01 PM
Formulas dealing with text data Bagia Excel Worksheet Functions 6 June 20th 05 10:29 PM


All times are GMT +1. The time now is 04:34 PM.

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"