Android Question downloaded file to a list

Discussion in 'Android Questions' started by a2stepper, Feb 10, 2015.

  1. a2stepper

    a2stepper Member Licensed User

    i've downloaded a file (20+ lines) with httpjog, and would like to put it in a list per line or a string array.
    any suggestions.
    i can get the complete file in a string in jobdone sub.
    thanks.
    paul allen
     
  2. NJDude

    NJDude Expert Licensed User

    You could use REGEX.Split to extract each line.
     
  3. DanteS

    DanteS Member Licensed User

    If you have the file in a string variable, named, for example myfile, you have to cut the string in lines (detecting the CRLF characters) and ading each line to the list

    You detect the CRLF characters with n=myfile.IndexOf(chr(13) & chr(10))
    You obtain the line with linex=myfile.Substring2(0,n)
    You add the line to the list with mylist.Add(linex)
    You truncate the rest of the file with myfile=myfile.SubString(n+2)
     
  4. a2stepper

    a2stepper Member Licensed User

    thanks for the suggestions, i'll give them a look and try.
    paul
     
  5. a2stepper

    a2stepper Member Licensed User

    Man!!! then REGEX.Split is to simple, working in 5 minutes.
    i've been spending last 3 hours trying to split using all sorts of mid left and right of string.
    thanks.
     
    DonManfred likes this.
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice