if you want to spit back the original header and footer you can store those temporarily in a table in access and just use the same method instead of generating the header/footer you would read it back as part of a recordset.
if you want to spit back the original header and footer you can store those temporarily in a table in access and just use the same method instead of generating the header/footer you would read it back as part of a recordset.
Found an error in the import code. Delete the line in red.
Added Write routine.....Code:If Len(Trim(FileToRead)) > 0 Then ' open read text file RF = FreeFile Open FileToRead For Input As #RF Else Close #RF '<<<-- Delete this line MsgBox "No file selected. Exiting routine" Exit Sub End If
Steve!
This works great Thank you so much. And it is very clearly written where I can either understand or research to get a better idea of what the code is doing.
And thanks to everyone else that chimed in to help
Just a word of warning if you're going to use the freefile method instead of filesystemobject commands. the freefile method will not allow you to read anything other than a carriage return/line feed as an end of line, for instance if you may get files from a unix system unix only has a line feed terminator, that's why I usually stick to filesystemobject commands, they're much more flexible and allow a much wider array of commands you can manipulate your files with.
rpear:
Didn't know that about Unix systems. I could very well get feeds from Unix systems in the future so this is very good info. Thanks!
@rpeare
I didn't know about the Unix system having only a line feed terminator. I don't/haven't received any text files from a Unix system, but thanks for the info. I guess I'll have to start studying the File System Object...
can you provide a sample database and a sample file with what you have so far.
wow mispost.. not sure how I did that