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

Find a replace between files

 
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi everyone!

I need to write a little program that reads from file_1 two values per line, and then reads from file_2 if the first value of file_1 is there and replace in file_2 (or write in another file) the new value.

For example

file_1:
45404500705804504196740100
45404500705805004196740101

file_2:
584195497000 454045007058003
584195497001 454045007058045
584195497002 454045007058030
584195497003 454045007058050

New file:
584195497000 454045007058003
584196740100 454045007058045
584195497002 454045007058030
584196740101 454045007058050

Thanks for any help you can give me. I don't need actual code, but the functions or path I should take

Thanks!
 
Sheriff
Posts: 11343
Mac Safari Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Aiglee Castillo:
...I don't need actual code, but the functions or path I should take...


Is there a specific part of this process that you're questioning?

If not, then here's my general advice: Describe your process in English before starting to code, breaking it down into detailed steps. (Something like: Read this value and store it here. Compare this variable to that variable. If this specific condition is true, then...) Once you have the process (logic) defined, then you can start translating it into code.
 
Being a smart alec beats the alternative. This tiny ad knows what I'm talking about:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic