• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • paul wheaton
  • Ron McLeod
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

get file from String

 
Ranch Hand
Posts: 162
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello joseph here

this are the list of files got through ftp protocol.
how can i get the file name as upd0025768122008112225.txt through any methods of String

08-12-08 12:06PM 50 upd0025768122008112225.txt
08-12-08 12:06PM 50 upd0025768122008112349.txt
08-12-08 12:06PM 111 upd0025768122008112408.txt
08-12-08 12:06PM 107 upd0025768122008112458.txt
08-13-08 04:27PM 107 upd0025768122008112460.txt

itis very urgent
 
Rancher
Posts: 3742
16
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If your file names are always the same length then you could use the substring method.
If your file names are different lengths but don't contain spaces, you could use the lastIndexOf and substring methods.
If your file names are different lengths and contain spaces, but are always preceeded by date, time and size fields, you could use the indexOf and substring methods. There's probably a regex pattern to do it as well.

Have a go and let us know what you come up with.
 
reply
    Bookmark Topic Watch Topic
  • New Topic