Re: python copy selected lines from one file to another using argparse or getopt

2014-01-08 Thread Dave Angel
On Wed, 8 Jan 2014 13:51:40 -0800 (PST), sagarnild...@gmail.com wrote: I am trying to write a program in python which searches for user specified words in a txt file and copies the selected lines containing that word into another file. John Gordon has given you a good start on argument parsing

Re: python copy selected lines from one file to another using argparse or getopt

2014-01-08 Thread Mark Lawrence
On 08/01/2014 21:51, sagarnild...@gmail.com wrote: I am trying to write a program in python which searches for user specified words in a txt file and copies the selected lines containing that word into another file. Also the user will have an option to exclude any word. (e.g Suppose the user

Re: python copy selected lines from one file to another using argparse or getopt

2014-01-08 Thread John Gordon
In sagarnild...@gmail.com writes: > But I don't know how to: > Include multiple search word and exclude words > How to denote them by -e and -s. I have seen the argparse and the getopt > tutorial. But there's no tutorial on this specific topic. This should help you get started: import arg

python copy selected lines from one file to another using argparse or getopt

2014-01-08 Thread sagarnildass
I am trying to write a program in python which searches for user specified words in a txt file and copies the selected lines containing that word into another file. Also the user will have an option to exclude any word. (e.g Suppose the user searches for the word "exception" and want to exclude