Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 747
Default 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
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
Saving a worksheet as . prn text file - record length dochoa Excel Discussion (Misc queries) 1 October 11th 06 07:47 PM
Import partial record from text file string goss[_37_] Excel Programming 1 November 16th 04 07:38 PM
Import partial record from text file string goss[_36_] Excel Programming 1 November 16th 04 03:45 AM
How To Delete First Record In A Text File MarkInSalemOR Excel Programming 0 November 8th 04 09:55 PM
Shell command and exe file conundrum Greg Wilson[_4_] Excel Programming 2 September 4th 04 09:24 PM


All times are GMT +1. The time now is 03:41 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"