19 replies
by dklippert
by jason1
by jason1
by c1980
Would you consider opening the text file with VB code as a text ISAM database using a database recordset object . You could then search for records and replace the text field with the text you needed. You could search for and change values for fields on individual records pretty easy. You only need to identify what delimiter the records use for each field.
All of the work in getting the data and each record is handled by the ISAM driver - you only need to set the connection string. After that it is a piece of cake to find/replace/update a record in the text file.
by jason1
That sounds great, but.. as stated before.. no other software or drivers can be installed in these machines, its just Win98 and the client software. Yes, it is as much a pain as it sounds ;-)
Thank you for your response though, I will definately keep that in mind for any projects I'm not so constrained with!
by miket
If the text file is delimited, you could import the text file into a MSAccess database and use SQL to update the records necessary, then export it back to a text file. This would give you the option of having an index on your work table that would make the SQL run very quickly.
Good luck,
Mike T.
by jason1
by miket
by jason1
by c1980
Wait a minute! Are we taking the same VB language?
If you cannot even add ADO or DAO which are basic components of VB, then you will need to add something else to perform the search and replace (like VB reqular expressions). Or you are limited to aFor/Each loop if no other basic vb components can be added. Using the ISAM drivers may have confused you - this is driven by ADO/DAO. You do not even need a MDB file - you only need to create a recordset on the text file and open it like a db.
by jason1
A) Does this require I install -any- files or services to a machine for it to work (Basic Windows98 install - its bad enough I will have to install the vb6 runtime to these)
B) Will I have to change anything about the file, other that the data itself? (No adding headers, etc)
C) These are large files, each record has 200+ fields. They also have quotation marks. Will I be able to change individual fields, or does this write out each line to another file?
D) Can I get some sortof example? :)
Thanks
-Jason
by jason1
A) Does this require I install -any- files or services to a machine for it to work (Basic Windows98 install - its bad enough I will have to install the vb6 runtime to these)
B) Will I have to change anything about the file, other that the data itself? (No adding headers, etc)
C) These are large files, each record has 200+ fields. They also have quotation marks. Will I be able to change individual fields, or does this write out each line to another file?
D) Can I get some sortof example? :)
Thanks
-Jason
by jason1
by johnfriz
Hi,
The search and replace idea sounds about the best one.
First off, you have said that no software or services can be *installed* on the machine. Is it permissible to copy a standalone .exe to the machine, run it, then remove the .exe again??
If the answer to this is Yes, then, because VB has good file handling and string manipulation, it would be a simple matter to write a standalone application that will do it.
There would be no need for excel, access or anything else like that (Trust me: I recently had to do a scan and extract from an 11MB file using just VB and its string manipulation functions!!!)
A couple of assumptions would be:
1) The name of the item that you want to change the prices on is known.
2) The old prices are either known (which they should be if you are modifying an existing file) or they are somehow identified in the line of product data (perhaps with a $ or ? sign)
3) The new prices are known (obviously)
4) There is a direct correlation between the old price and the new price.
i.e. if the old price is ?4.50 it is to be changed to ?4.75 in ALL cases.
Assuming that the above are true, then writing the VB application could be done in a matter of hours.
I would be happy to provide more information if you like, assuming I am on the correct track
Regards,
John
P.S. A sample line of data would be very handy.
by jason1
by rrv
Forget using ISAM or mdb. VB comes handy with such problems. Check for Replace, Instr, InstrRev mid, left and right - String functions in VB. VB has samples also which would help you instead of me giving sample code or direct solution for you. Tryit for yourself. It is easy.
All the best.
by jason1
by jason1
by jason1
This discussion is closed to new replies.
Trending Web Development posts
Sort by Trending