If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > Visual Basic > store file in Excel

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 07-19-09, 09:13
kato01 kato01 is offline
Registered User
 
Join Date: Nov 2004
Posts: 17
store file in Excel

I have a file with 3439726 characters. When I open the file with a text editor, I see 11183 lines of text.
I need to load this file in excel (line by line) and the maximum number of lines a worksheet would accept is 65536.
Therefore I need to read the file and split it in three, to be able to load each of the three parts in a separate worksheet.
for some reason, I cannot read the file 'line by line':
when I use <<line input#1, t$>>, t$ IS the whole file, so I am trying to find the character which splits the file into lines.

So I used this code:

Open f$ For Input As 1
Open g$ For Output As 2
Line Input #1, t$ <=== get the whole file as a string
Ln = Len(t$)
For i = 1 To Ln
s$ = Mid(t$, i, 1)
Print #2, s$, Asc(s$)
Next i
Close 1
Close 2

hoping to find a ASCII value I could use as separator. When I look at the output file at the location where the 'line breaker' should be, I get nothing, just two empty spaces,
i.e. instead of seeing some values for s$, Asc(s$), I see an empty line.

Looks like for that character, there is no ASCII value. I don't get it.

Please advise

Thank you

Katto01
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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