Re: Searching for txt file and importing to ms access



Once i have this working i was planing to kept all the txt files as logs,
i'd have to give them a real name and stuff.

But thanks for you help so far

Mark


"Mike Meyer" <mwm@xxxxxxxxx> wrote in message
news:86br1kunnd.fsf@xxxxxxxxxxxxxxxxxx
> "Mark Line" <mline@xxxxxxxxxxxx> writes:
>> I'm managed to get some code to download a message from the email account
>> and save it to a text file, does any one have a link to some sample code
>> to
>> search though a file until a string of characters is matched? Or could
>> point me to some functions that may help me with this?
>
> datafile = open("c:\\myfile.txt", "r")
> data = datafile.read()
> datafile.close()
> start = data.index(myindicator)
>
> will leave start as the index in data where the the string in
> myindicator first appears. If you want the end of myendicator, use
> start = data.find(myindicator) + len(myindicator).
>
> Have you considered not saving the message to disk? You can manipulate
> it all in memory.
>
>> I've also managed to connect to my access database, and just print out a
>> field in a table, but I cant find anywhere on the web that will help me
>> to
>> import data? Any help would be great?!
>
> Can't help with that. The phrase "win32com" comes to mind, but I'm not
> a windows person.
>
> <mike
> --
> Mike Meyer <mwm@xxxxxxxxx> http://www.mired.org/home/mwm/
> Independent WWW/Perforce/FreeBSD/Unix consultant, email for more
> information.


.



Relevant Pages

  • Re: SIGSEGV in getdir()
    ... just because you don't get a segmentation fault ... receiving a layer 7 acknowledge upon delivery of string. ... commenting out my pushfunction that pushes the logs onto my ... If you know what to look for valgrind can be very useful. ...
    (comp.unix.programmer)
  • Re: Whats right with FORTH and wrong with c.l.f.
    ... I doubt anyone would claim string handling as a Forth forte. ... parsing data in ASCII format *is* a Forth forte. ... Most likely a Forth programmer will happily hardcode a special purpose ... sample code, or at least the very little sing of code usage. ...
    (comp.lang.forth)
  • Re: If value is in a list
    ... there an easier or more efficient way, than the sample code below, to ... depending on the JavaScript implementation. ... If the list is a String of separated numbers, ... TP/BP/Delphi/jscr/&c, FAQ items, links. ...
    (comp.lang.javascript)
  • Re: How can I programmatically relink OLEs in a Word document?
    ... I was told that the sample code in your response applies to shapes and I ... For generating from the old sourcefullname ... The slot for string processing is below: ... Dim strLink As String ...
    (microsoft.public.word.vba.general)
  • Re: Look what Ive found
    ... I'm not sure what created that entry in my logs. ... > other boxes, found SSH, gathered the init string for it, then ... port isn't considered portscanning. ...
    (comp.os.linux.security)