Re: Linefeed to CrLf
- From: rkc <rkc@xxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Sat, 10 Mar 2007 12:04:49 -0500
Bob Quintal wrote:
rkc <rkc@xxxxxxxxxxxxxxxxxxxxxxxx> wrote in
news:45f2a168$0$8956$4c368faf@xxxxxxxxxxxxxx:
Bob Quintal wrote:I'll know monday. Currently I'm reading the fileup to a line feed, and parsing that into the destination table. It should not take long to code both ways and test which is faster.rkc <rkc@xxxxxxxxxxxxxxxxxxxxxxxx> wrote inI can't answer that because I do not know what you have to do
news:45f2308f$0$24723$4c368faf@xxxxxxxxxxxxxx:
Bob Quintal wrote:Would be faster to write back to disk and do a file import,I'm receiving data in text files from a unix sustem thatFunction ReadAll(path As String) As String
onlu puts a Lf character at the end of each row. Access
insists on Cr or CrLf or it sees the file as 1 row 700Kb
wide and chokes.
Is there a better way of importing this file than using the
open #1 command and building strings in a do loop one
character at a time?
Dim fh As Long
fh = FreeFile
Dim s As String
'add error handling
Open path For Binary As #fh
s = String$(LOF(fh), vbNullChar)
Get #fh, , s
Close fh
ReadAll = s
End Function
Sub test()
Debug.Print Replace(ReadAll("c:\bigFile.txt"), vbLf,
vbCrLf) End Sub
or just use mid() to split the string and stuff it into the
table
with the file. I posted assuming you would just write it back
to a file and go from there.
If that's the case I might just try leaving it in memory after the
vbcrlf replace and doing something like:
dim lines as variant
dim count as long
lines = Split(WholeThing, vbcrlf)
for count = 0 to ubound(lines)
call Parse(lines(count))
next
.
- Follow-Ups:
- Re: Linefeed to CrLf
- From: rquintal@xxxxxxxxxxxx
- Re: Linefeed to CrLf
- References:
- Linefeed to CrLf
- From: Bob Quintal
- Re: Linefeed to CrLf
- From: rkc
- Re: Linefeed to CrLf
- From: Bob Quintal
- Re: Linefeed to CrLf
- From: rkc
- Re: Linefeed to CrLf
- From: Bob Quintal
- Linefeed to CrLf
- Prev by Date: Re: Help with sorting
- Next by Date: Help with numeric field, msgbox
- Previous by thread: Re: Linefeed to CrLf
- Next by thread: Re: Linefeed to CrLf
- Index(es):
Relevant Pages
|