Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Enetring data in file help!  RSS feed

 
adeeb alexander
Ranch Hand
Posts: 268
  • Mark post as helpful
  • send pies
  • 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
alexander
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!