Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22
Default import text-file - strings contain cr-lf

I have a text-file I wish to import into an Excel spreadsheet.

This file's data-fields are comma-separated. Data-fields which contain text
are quote-delimited .... but the text-data-fields can contain CR-LF.

Excel's Data Get External Data Import Text File menu option will see
each such CR-LF as starting a new row -- which I don't want.

Has anyone worked-up a solution for this kind of import problem ?


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,718
Default import text-file - strings contain cr-lf

I'd look at manipulating the data once it's in a worksheet, if possible. If
it is not possible then you may have to use VB's low level file i/o
functions. If you haven't worked with them it can be a challenging
experience but you can get the byte-by-byte control that you want.

This is a pretty good article on the subject:

http://support.microsoft.com/default...eio/fileio.asp

You might look at using Line Input and parsing/concatenating according to
your needs.

--
Jim Rech
Excel MVP


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 70
Default import text-file - strings contain cr-lf

Hi John,

What version of XL are you using? Certainly XL 2000 doesn't exhibit the
behaviour you mention. For me XL correctly ignores the CR-LF (and for that
matter commas etc) that appear within quotes.

Regards,

Peter Beach

"John A Grandy" wrote in message
...
I have a text-file I wish to import into an Excel spreadsheet.

This file's data-fields are comma-separated. Data-fields which contain

text
are quote-delimited .... but the text-data-fields can contain CR-LF.

Excel's Data Get External Data Import Text File menu option will see
each such CR-LF as starting a new row -- which I don't want.

Has anyone worked-up a solution for this kind of import problem ?




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
find and replace numeric strings in larger text strings Mr Molio Excel Worksheet Functions 8 November 9th 11 05:17 PM
Can I import text file of cash flow to excel file then use formula Bumpa Excel Discussion (Misc queries) 2 May 28th 10 04:22 PM
Set Defaults in File Import of a Text File Dkline Excel Worksheet Functions 2 January 28th 08 06:20 PM
Would Like to Automate Batch File Creation and Text FIle Import socrtwo Excel Discussion (Misc queries) 2 August 18th 06 03:54 PM
Get External Data, Import Text File, File name problem Scott Riddle Excel Programming 1 July 11th 03 05:40 PM


All times are GMT +1. The time now is 05:55 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"