Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Text file db where record already exists conundrum
BACKGROUND:
I have successfully written code that saves and imports to/from a .txt file database. The data source is non-contiguous (in fact derives from two worksheets) but I have successfuly resolved this. I save each data set to a single line in the .txt file using a semicolon as a delimiter. Each data set is identified by its date which starts the line followed by a semicolon and then the rest of the data (semicolon dilimited). I use the Split function to create an array of values when importing (works great). Not done yet, but I want to create a different .txt file for each month of data. This should be easy since the "Open xyz.txt For Append As #1" statement will create a new file if it doesn't already exist. I intend to simply strip the month/year from the data set's date and use this as the name when opening the file. It should automactically create a new file with this name when the month changes. PROBLEM: If a record already exists in the .txt file when saving and I either want to overwrite the existing record or prevent duplication, then I can't come up with a simple solution. Efforts so far are becoming extremely convoluted. Googling hasn't been successful. Hoping someone knows of simple working code that has resolved this or can point me in the right direction. Note that I am working extremely long hours and can't spend much time on research. I need to keep it simple and preferably in familiar territroy. I need to get this up and running for someone else to take over. Much appreciative, Greg |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Saving a worksheet as . prn text file - record length | Excel Discussion (Misc queries) | |||
Import partial record from text file string | Excel Programming | |||
Import partial record from text file string | Excel Programming | |||
How To Delete First Record In A Text File | Excel Programming | |||
Shell command and exe file conundrum | Excel Programming |