system
November 19, 2010, 9:35pm
1
(imported topic written by TimRozycki91)
I need to take a substring from one file, use it to find a line from another file then display both of these together. The tricky part, of course, is that there are multiple substrings from the first file and I need the substring of the first file displayed with the appropriate line from the second file.
Noah
November 19, 2010, 9:48pm
2
(imported comment written by NoahSalzman)
These types of questions are always much easier to answer if you can give us some sample data.
system
November 19, 2010, 10:38pm
3
(imported comment written by TimRozycki91)
OK, let’s add some details. This will be a simplified example that I hope deals with the specific point I am having problems with.
FILE: C:\data_file_1.txt FILE: C:\data_file_2.txt
App_name_1 URI for App_name_1
App_name_2 URI for App_name_2
App_name_3 URI for App_name_3
What I want to do is take the names from the first data file, find the associated line in the seconde data file and display them like this:
App_name_1, URI for App_name_1
App_name_2, URI for App_name_2
App_name_3, URI for App_name_3
Noah
November 19, 2010, 11:36pm
4
(imported comment written by NoahSalzman)
I’m sure we are going to need to get a little more complicated once we start dealing with real data, however, here is the general pattern we can use:
Q: ((lines of file “data_file_1.txt”), (lines of file “data_file_2.txt”)) whose (item 0 of it = following text of first "for " of item 1 of it)
A: App_name_1, URI for App_name_1
A: App_name_2, URI for App_name_2
A: App_name_3, URI for App_name_3