Win a copy of 97 Things Every Java Programmer Should Know this week in the Java in General forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • salvin francis
  • fred rosenberger

how to display content of a text file that is named the same as the data in a another text file

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have one text file that is updated with 4 characters periodically, I need to read this file and echo the content of another text file named the same name as the updated text file characters. For example, in the periodically updated text file, there might be "K04EW" or similar on the first line. There would be in the same directory a text file called K04EW.txt and others in which I need to echo the content of those files.

Thank you for your time.
 
Rancher
Posts: 4588
47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Read text from first file
Stream text from second file called <text from first file>.txt to console.


Which step are you having issues with, because there's not much else involved.
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thank you so much
 
Who among you feels worthy enough to be my best friend? Test 1 is to read this tiny ad:
Devious Experiments for a Truly Passive Greenhouse!
https://www.kickstarter.com/projects/paulwheaton/greenhouse-1
    Bookmark Topic Watch Topic
  • New Topic