Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
How to remove a line of data from a file
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  3 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
pank...@gmail.com  
View profile  
 More options Nov 5 2012, 4:34 pm
Newsgroups: comp.lang.idl-pvwave
From: pank...@gmail.com
Date: Mon, 5 Nov 2012 13:34:46 -0800 (PST)
Local: Mon, Nov 5 2012 4:34 pm
Subject: How to remove a line of data from a file
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


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
pank...@gmail.com  
View profile  
 More options Nov 5 2012, 4:36 pm
Newsgroups: comp.lang.idl-pvwave
From: pank...@gmail.com
Date: Mon, 5 Nov 2012 13:36:43 -0800 (PST)
Local: Mon, Nov 5 2012 4:36 pm
Subject: Re: How to remove a line of data from a file
The final list I want is

2
6
8
9
12
15


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
wlandsman  
View profile  
 More options Nov 5 2012, 5:27 pm
Newsgroups: comp.lang.idl-pvwave
From: wlandsman <wlands...@gmail.com>
Date: Mon, 5 Nov 2012 14:27:30 -0800 (PST)
Local: Mon, Nov 5 2012 5:27 pm
Subject: Re: How to remove a line of data from a file
I find Craig Markwardt's cmset_op.pro very useful for this sort of thing.
( http://cow.physics.wisc.edu/~craigm/idl/down/cmset_op.pro )

IDL> a = [1,2,4,5,6,8,9,10,12,15,16]
IDL> b = [1,5,10,16]

IDL> print,cmset_op(a,'and',/not2,b)
           2           4           6           8           9          12
          15


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »