×

Discussion Board

Results 1 to 4 of 4

Thread: Reading Text

  1. #1
    Registered User
    Join Date
    Oct 2007
    Location
    Brasil
    Posts
    39

    Reading Text

    My script works perfectly in Interaticve Console, but when I select Run Script he does not return the lines of the text file. Where Can I say that the error.


    f = open("e:\\clientes.txt")
    lst = f.readlines()
    x = len(lst)

    for i in range(x):
    a = lst[i].find(";")
    n = lst[i][0:a]
    c = lst[i][a+1:]
    print n,c




    Thanks for helping

  2. #2
    Super Contributor
    Join Date
    Oct 2007
    Location
    Deva, Romania
    Posts
    3,471

    Re: Reading Text

    I think works for me. It displays what's before ; and what's after it. But I'm not suire that's what you want.
    Could you please show me what your "clientes.txt" file contains so that I can try with that?

  3. #3
    Registered User
    Join Date
    Oct 2007
    Location
    Brasil
    Posts
    39

    Re: Reading Text

    Ok. The data of that file are extracted from MS EXCEL containing: name_contact and name_company


    a = lst[i].find(";")
    n = lst[i][0:a] # name_contact
    c = lst[i][a+1:] # name_company

    Tks

  4. #4
    Registered User
    Join Date
    Feb 2008
    Posts
    3

    Re: Reading Text

    Do you have accents in your file ?
    On my 6630, print does not like accents...

Similar Threads

  1. Problem while Reading text file in Nokia3650
    By lalithunt in forum Mobile Java General
    Replies: 5
    Last Post: 2008-07-30, 17:19
  2. Reading A Text File Woes
    By _nomad_ in forum Symbian
    Replies: 1
    Last Post: 2005-02-02, 10:09
  3. Replies: 0
    Last Post: 2004-11-24, 18:49
  4. Problem about Reading Chinese Text file?
    By goeast in forum Mobile Java General
    Replies: 0
    Last Post: 2002-09-18, 03:25
  5. Replies: 0
    Last Post: 2002-07-24, 16:11

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×