Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Read/Copy String in a third file

Status
Not open for further replies.

joda124

Technical User
Jan 17, 2008
9
IT
Dear all, i have a problem:

I have first text file with this info:

Name1, Surname1, code1, address1 ---- (first row)
Name2, Surname2, code2, address2 ---- (second row)
……………………………………..
for many row…!

I have a second text file with this similar info:

Name1, Surname1, code1, telephonenumber1 ---- (first row)
Name2, Surname2, code2, telephonenumber2 ---- (second row)
……………………………. ……………….
for many row…!

I would like to make this: read,in first file,for every row, numeric string “ code “ and search it into second file for every row ! When string found print entire row in a third files.

Please help me I do not succeed to make this, please indicate me the best way to realize this simple script.

Thank you !!!
 
joda124,

Are you wanting to match:
"Name1, Surname1, code1" in file1
*** with ***
"Name1, Surname1, code1" in file2 ?

Then, what is the format of the line or which line do you want to write to file3?
 
Dear Ambl

For example i have two text files, i want to make:

1) Read characters from 1 to 5 in every row in file1 (Range1)
2) Read characters from 1 to 5 in every row in file2 (Range2)

If both character range (Range1 and Range2) are equal, print in a third file the relative entire file2 row containing Range2.

I hope to be explained clearly.

Thank you !!!
 
It might help if you post your code so far, with a summary of where you are stuck.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top