• 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:
  • Campbell Ritchie
  • Tim Cooke
  • Devaka Cooray
  • Ron McLeod
  • Jeanne Boyarsky
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Carey Brown
  • Tim Holloway
Bartenders:
  • Martijn Verburg
  • Frits Walraven
  • Himai Minh

error in reading line

 
Ranch Hand
Posts: 518
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I am trying to read the textfile which has numbers 1 to 99 and its equivalent voice file (for example 1-N001,2-N002 etc...). I can able to read it. But what i need is for example if i type 1,22,3,45. It should match 1 with the value 1, 22 with the value 22 in the text file in the text file , 3 with the value 3 in text file and 45 with 45 in the text file and it should play 1 lakh, 22 thousand,3 hundred and 45. But instead it is playing 1 lakh, 3 hundred,22 thousand and 45. The file is reading the lines one by one. so before 22 it is reading 3. How can i readaccording to the order typed.



please assist me solve this issue.

Thanks
 
Ranch Hand
Posts: 87
Opera Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Load the file in to a map with your index number as the key and voice file name as the value. Then lookup the map using your input value tokens (cvalue , c1 value etc) ....

Just add , the code you have written is too raw and buggy.. check how you can imrpove it.
 
preethi Ayyappan
Ranch Hand
Posts: 518
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks. Can you show me a sample please?
 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Remove lines 19, 27 & 35...Your streaming the dynamic entry you created in the voiceFile variable and then streaming a hard-coded entry following each line in question.

Hope it helps.
 
Marshal
Posts: 76888
366
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Clarence Gillespie, welcome to the Ranch
 
preethi Ayyappan
Ranch Hand
Posts: 518
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks prem. I have done as per your advice and now the issue has been solved. I have created an array of voice file name with index and mapped the dynamic value with index and got the voice file name and able to stream properly.

Gillespie, I have to stream both the dynamic file and also the hard coded voice file. both are different files.

 
There's a way to do it better - find it. -Edison. A better tiny ad:
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic