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: 2
Default Problem reading text file

From an Ecel-VB macro I need to do the following:
1) open a text file for reading (in my case. a mail message file)
Dim fileIn As String
Dim thisLine(500) As String
Open fileIn For Input As #1
Open fileOut For Output As #2
2) read each line from this file
Input #1, thisLine
3) process the line and then write it to an output text file, similar
to the input one.

Problem.
Lines like the following ones (I add CRLF to display the carriage
return chars):
Received: from smtp-in10.gmail.com (192.168.32.68) by ims88c.gmail.com
(18.0.024.3)CRLF
id 47DA621000B94BAB for ; Wed, 28 May 2008
20:00:24 +0200CRLF
Received: from outrelay05.gmail.com (172.31.0.121) by smtp-
in10.gmail.com (7.3.120)CRLF
id 4611FE643F754F89 for
; Wed, 28 May 2008
20:00:24 +0200CRLF

are read from the macro as:
Received: from smtp-in10.gmail.com (192.168.32.68) by ims88c.gmail.com
(18.0.024.3)
id 47DA621000B94BAB for
; WedCRLF
28CRLF
May 2008 20:00:24 +0200CRLF
Received: from outrelay05.gmail.com (172.31.0.121) by smtp-
in10.gmail.com (7.3.120)
id 4611FE643F754F89 for
; WedCRLF
28CRLF
May 2008 20:00:24 +0200CRLF

That is:
1) spaces at the beginning of the line are trimmed (" id
4611FE643"...)
2) lines are split ("Wed, 28 May"...)

Why and which solution?
Thanks.
 
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
Reading from a text file Jeff Excel Discussion (Misc queries) 1 November 8th 06 08:47 PM
Reading a text file ? WTG Excel Worksheet Functions 2 February 22nd 05 01:29 AM
Reading a text file WTG Excel Discussion (Misc queries) 2 February 22nd 05 01:27 AM
Problem Reading Delimited File Martin Swanston Excel Programming 2 February 23rd 04 10:54 AM
Help reading in a text file Mike[_60_] Excel Programming 1 January 21st 04 06:29 PM


All times are GMT +1. The time now is 08:19 AM.

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"