• 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 ...
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Junilu Lacar
  • Rob Spoor
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Jesse Silverman
  • Stephan van Hulst
  • Carey Brown
  • Al Hobbs
  • Piet Souris
  • Frits Walraven

Enetring data in file help!

Ranch Hand
Posts: 268
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all.
I have written a program to enter that ask filename and the data to enter. So my output will be like this

Enter file name and data.
file1 what is your name, file2 my name is alexander

Till here its fine i am able to do what i need. I have used the split method to split the both with comma. So my problem is that a user can enter a value with a comma also, like

"Enter file name and data.
file1 what is your name, my name is alexander , file2 i am a beginner".

Now the given string will be split into three parts which cause a problem. So please someone help me out. How can i distinguish between a filename and the value from the given string. The user can enter like these values in 20 or more files. Please help me out

Thanks and Regards
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
    Bookmark Topic Watch Topic
  • New Topic