How to remove a line of data from a file [message #81965] |
Mon, 05 November 2012 13:34 |
panklbj
Messages: 5 Registered: November 2012
|
Junior Member |
|
|
I have got two list, list A is a longer one which has got some non-repetitive numbers and list B is a shorter one which has got some numbers from list A(the numbers in list B are again non-repetitive). I mean what is contained in list B is also found in list A. Now I need to remove those numbers found in list B from list
A. If I want to do the opposite, it is easy, but I just don't know how to do it the other way around.
List A:
1
2
4
5
6
8
9
10
12
15
16
List B:
1
4
5
10
16
Here is the two for loops I use in order to extract those numbers found in list B from list A and write the numbers to another file, but I don't know how to write the numbers from list A which are NOT found in list B.(num1 is from list B and num is from list A)
for i=0,a-1 do begin
for j=0,b-1 do if (num1[j] ne num[i]) then printf,1,num[i],words[i],format="(I6,a10)" ;else printf,2,num[i],words[i],format="(I6,a10)"
endfor
|
|
|