• 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
  • paul wheaton
  • Liutauras Vilda
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Scott Selikoff
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
  • Frits Walraven
Bartenders:
  • Stephan van Hulst
  • Carey Brown

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: 80066
410
  • 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.

 
Politics n. Poly "many" + ticks "blood sucking insects". Tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic