-
Line Comparison
Hey Guys,
I have run into a somewhat difficult problem that I am hoping the C gurus out here can help me. What I am trying to do is a kind of line comparison in two files.
Both files have lines of numbers in them. What I am trying to do is assign a color to each line in file 1 and then output the other file(with the same number in differnt lines) with the same color.
So if file 1 is
1 2 3
4 5 6
And file two is
1
3
2 4
5 6
then I want the output to be like
1
3
2 4
5 6
Is this even possible in C? I am so confused that I am just about ready to call it quits and do actual comparison for the ~ 500 numbers. Please help! Thanks!
-
What is it you plan on reading this file in? Rather, what type of file are you making? If you are making an html file or a word doc or something, then yes, you can color text, but it doesn't have anything to do with C. It has to do with whatever program is reading whatever file you are making.
Quzah.
-
OMG Fckkk I had forgotten I could save the results as html. Dude Thank you!!!
I think this should work.
1). open two files and save to two arrays
2). assign a color element to each line in array 1
3). read every number in array 2 and find where it is in array one. output with <color>number</color>
4). rinse and repeat
Dude you are a genius...Thank you!