f



copying nth line from a file to another file

Hi All,
I have a database table which is having a column, line_number. I nee
to query the table get the line_number and copy only those lines from 
source flat file to another file. I have not worked much with UNIX
Please let me know if anyone has implemented a similar logic.

Thank

--
supriy
-----------------------------------------------------------------------
supriya's Profile: http://fantasticunix.com/forum/member.php?userid=6
View this thread: http://fantasticunix.com/forum/showthread.php?t=50790

0
7/29/2008 5:26:57 AM
comp.unix.shell 15484 articles. 3 followers. Post Follow

6 Replies
843 Views

Similar Articles

[PageSpeed] 3

On 2008-07-29, supriya <supriya.3daobz@no-mx.forums.yourdomain.com.au> wrote:
>
>
>
> Hi All,
> I have a database table which is having a column, line_number. I need
> to query the table get the line_number and copy only those lines from a
> source flat file to another file. I have not worked much with UNIX.
> Please let me know if anyone has implemented a similar logic.
>
> Thanks
>
>
n=$(database query)
sed -n "${n}p" <file1 >>file2
0
Bill
7/29/2008 6:06:40 AM
2008-07-29, 06:06(+00), Bill Marcum:
> On 2008-07-29, supriya <supriya.3daobz@no-mx.forums.yourdomain.com.au> wrote:
[...]
>> I have a database table which is having a column, line_number. I need
>> to query the table get the line_number and copy only those lines from a
>> source flat file to another file. I have not worked much with UNIX.
>> Please let me know if anyone has implemented a similar logic.
[...]
> n=$(database query)
> sed -n "${n}p" <file1 >>file2

Or

sed "$n!d;q" < file1 >> file2

which should be faster as sed will stop reading file1 after it
has found the nth line.

-- 
St�phane
0
Stephane
7/29/2008 8:50:45 AM

On 7/29/2008 3:50 AM, Stephane CHAZELAS wrote:
> 2008-07-29, 06:06(+00), Bill Marcum:
> 
>>On 2008-07-29, supriya <supriya.3daobz@no-mx.forums.yourdomain.com.au> wrote:
> 
> [...]
> 
>>>I have a database table which is having a column, line_number. I need
>>>to query the table get the line_number and copy only those lines from a
>>>source flat file to another file. I have not worked much with UNIX.
>>>Please let me know if anyone has implemented a similar logic.
>>
> [...]
> 
>>n=$(database query)
>>sed -n "${n}p" <file1 >>file2
> 
> 
> Or
> 
> sed "$n!d;q" < file1 >> file2
> 
> which should be faster as sed will stop reading file1 after it
> has found the nth line.
> 

The OP said "...get the line_number and copy only those LINES...". i.e. there's
multiple line numbers output from the database query. I think what he meant to
say was "...get the line_number COLUMN and copy only those lines...". So, the
result of the database query is probably a list of line numbers like:

3
17
25
....

rather than just one line number, so the sed solutions won't work as posted.

Here's an alternative:

awk -v n="$(database query)"
BEGIN{split(n,tmp); for (i in tmp) lines[tmp[i]]++} NR in lines' file1 > file2

If the file's very large, you could optimise by finding the max line number in
the BEGIN section and exit after that line's processed.

Regards,

	Ed.

0
Ed
7/29/2008 1:04:41 PM
On 7/29/2008 8:04 AM, Ed Morton wrote:
<snip>
> awk -v n="$(database query)"
> BEGIN{split(n,tmp); for (i in tmp) lines[tmp[i]]++} NR in lines' file1 > file2

No need for the "++":

awk -v n="$(database query)"
BEGIN{split(n,tmp); for (i in tmp) lines[tmp[i]]} NR in lines' file1 > file2

	Ed.

0
Ed
7/29/2008 1:07:11 PM
On Jul 29, 4:50=A0am, Stephane CHAZELAS <stephane_chaze...@yahoo.fr>
wrote:
> 2008-07-29, 06:06(+00), Bill Marcum:
>
> > On 2008-07-29, supriya <supriya.3da...@no-mx.forums.yourdomain.com.au> =
wrote:
> [...]
> >> I have a database table which is having a column, line_number. I need
> >> to query the table get the line_number and copy only those lines from =
a
> >> source flat file to another file. I have not worked much with UNIX.
> >> Please let me know if anyone has implemented a similar logic.
> [...]
> > n=3D$(database query)
> > sed -n "${n}p" <file1 >>file2
>
> Or
>
> sed "$n!d;q" < file1 >> file2
>
> which should be faster as sed will stop reading file1 after it
> has found the nth line.
>
> --
> St=E9phane
Would you explain/break apart  this line -- sed "$n!d;q" < file1 >>
file2-- for I don't full understand those flags?

Thanks
0
puzzlecracker
7/29/2008 1:36:54 PM
2008-07-29, 06:36(-07), puzzlecracker:
[...]
>> sed "$n!d;q" < file1 >> file2
>>
>> which should be faster as sed will stop reading file1 after it
>> has found the nth line.
[...]
> Would you explain/break apart  this line -- sed "$n!d;q" < file1 >>
> file2-- for I don't full understand those flags?
[...]

Because of the _double_ quotes, $n is expanded by the shell, so
it becomes 12!d;q (if the n shell variable contains 12) which
tells sed: if the current line is not line 12, delete it (and
start from scratch) on the next line.

Otherwise, quit, and as the line is not deleted, it is output as
-n was not provided.

d is the equivalent of "next" in awk (except that awk doesn't
print the current record by default).

The equivalent awk statement would be

awk 'NR != 12 {next} {print; exit}'

But of course, in awk, you'd rather write:

awk 'NR == 12 {print; exit}'

which in sed, you could write as:

sed -n '12{p;q;}'

Which I'll conceed is a bit more legible even though longer
than:

sed '12!d;q'

-- 
St�phane
0
Stephane
7/29/2008 6:48:00 PM
Reply:

Similar Artilces:

Copying a file to another file
Hi, I wrote the following C program to copy a file to another file. #include <stdio.h> #include <stdlib.h> static FILE *open_file ( char *file, char *mode ) { FILE *fp = fopen ( file, mode ); if ( fp == NULL ) { perror ( "Unable to open file" ); exit ( EXIT_FAILURE ); } return fp; } int main ( int argc, char *argv[] ) { /* int ch;*/ FILE *from; FILE *to; char *buffer; long lSize; if ( argc != 3 ) { fprintf ( stderr, "Usage: %s <readfile1> <writefile2>\n", argv[0] ); exit (1);/* E...

FAQ 5.2: How do I change one line in a file/delete a line in a file/insert a line in the middle of a file/append to the beginning of a file?
This message is one of several periodic postings to comp.lang.perl.misc intended to make it easier for perl programmers to find answers to common questions. The core of this message represents an excerpt from the documentation provided with Perl. -------------------------------------------------------------------- 5.2: How do I change one line in a file/delete a line in a file/insert a line in the middle of a file/append to the beginning of a file? Use the Tie::File module, which is included in the standard distribution since Perl 5.8.0. ------------------------------------------...

FAQ 5.2 How do I change one line in a file/delete a line in a file/insert a line in the middle of a file/append to the beginning of a file? #2 554047
This is an excerpt from the latest version perlfaq5.pod, which comes with the standard Perl distribution. These postings aim to reduce the number of repeated questions as well as allow the community to review and update the answers. The latest version of the complete perlfaq is at http://faq.perl.org . -------------------------------------------------------------------- 5.2: How do I change one line in a file/delete a line in a file/insert a line in the middle of a file/append to the beginning of a file? Use the Tie::File module, which is included in the standard distribution sinc...

FAQ 5.2 How do I change one line in a file/delete a line in a file/insert a line in the middle of a file/append to the beginning of a file? #3 554638
This is an excerpt from the latest version perlfaq5.pod, which comes with the standard Perl distribution. These postings aim to reduce the number of repeated questions as well as allow the community to review and update the answers. The latest version of the complete perlfaq is at http://faq.perl.org . -------------------------------------------------------------------- 5.2: How do I change one line in a file/delete a line in a file/insert a line in the middle of a file/append to the beginning of a file? Use the Tie::File module, which is included in the standard distribution since Perl 5.8.0. -------------------------------------------------------------------- The perlfaq-workers, a group of volunteers, maintain the perlfaq. They are not necessarily experts in every domain where Perl might show up, so please include as much information as possible and relevant in any corrections. The perlfaq-workers also don't have access to every operating system or platform, so please include relevant details for corrections to examples that do not work on particular platforms. Working code is greatly appreciated. If you'd like to help maintain the perlfaq, see the details in perlfaq.pod. -- Posted via a free Usenet account from http://www.teranews.com ...

FAQ 5.2 How do I change one line in a file/delete a line in a file/insert a line in the middle of a file/append to the beginning of a file? #2 325998
This message is one of several periodic postings to comp.lang.perl.misc intended to make it easier for perl programmers to find answers to common questions. The core of this message represents an excerpt from the documentation provided with Perl. -------------------------------------------------------------------- 5.2: How do I change one line in a file/delete a line in a file/insert a line in the middle of a file/append to the beginning of a file? Use the Tie::File module, which is included in the standard distribution since Perl 5.8.0. ------------------------------------------...

How to Add two lines using DCL on open VMS reading one line from one file and second from another file.
Hi All, Can some one please guide me how can i do this using DCL. Problem: We are having two file named Dire.txt Total of 39 files, 61673 blocks. Total of 50 files, 4555 blocks. Second File is size.txt Directory SYS$SYSDEVICE:[000000] Directory SYS$SYSDEVICE:[mandeep] We want output in one file like. Directory SYS$SYSDEVICE:[000000] size of directory will be "Total of 39 files, 61673 blocks". ...... Bob Gezelter wrote: > On Sunday, October 19, 2014 6:26:26 AM UTC-4, mandeep...@gmail.com wrote: >> Hi All, >> >> >> >>...

How to Add two lines using DCL on open VMS reading one line from one file and second from another file.
Hi All, Can some one please guide me how can i do this using DCL. Problem: We are having two file named Dire.txt Total of 39 files, 61673 blocks. Total of 50 files, 4555 blocks. Second File is size.txt Directory SYS$SYSDEVICE:[000000] Directory SYS$SYSDEVICE:[mandeep] We want output in one file like. Directory SYS$SYSDEVICE:[000000] size of directory will be "Total of 39 files, 61673 blocks". ...... mandeepsangwan1@gmail.com wrote 2014-10-19 12:26: > Hi All, > > Can some one please guide me how can i do this using DCL. > > Problem: We are having two file named Dire.txt > > Total of 39 files, 61673 blocks. > > Total of 50 files, 4555 blocks. > > Second File is size.txt > > Directory SYS$SYSDEVICE:[000000] > Directory SYS$SYSDEVICE:[mandeep] > > We want output in one file like. > > Directory SYS$SYSDEVICE:[000000] size of directory will be "Total of 39 files, 61673 blocks". > > ..... > I do not understand what your files and dirs output is trying to tell, there seems to be missing something. But... 1. Open both input files and the output file. 2. Read one line from each file. 3. Write both lines to the output file. 4. Goto 2. until eof on either file. What to do if the files have different number of lines is up to you. In article <af17e1d7-1d51-4067-91f1-c9bf58704343@googlegroups.com>, mandeepsangwan1@gmail.com writes:...

[vim] using a line in a file as shell command for output into same file
I have a file that quotes some linux commands, and want to be able to run that command from within the file and have the output come below it. For example, some lines in the file might be: blah blah $ vim --version | head -n 1 - I'll move the cursor to the line with the command on it, then hit some bound key, and want the output to look like this: blah blah $ vim --version | head -n 1 - VIM - Vi IMproved 7.1 (2007 May 12, compiled Oct 31 2007 06:25:17) I know I can read the output of the command by pasting it on the vim commandline with :r!command but I'm not sure h...

copy the last n-bytes of a big file into another file
Hi all, I would like to copy a the last part of a (quite big) file into another one (remove the header of few big images, basically remove the first 1024 bytes). I'm driving crazy, can you please help me? This one of the attempts (but it just copies the file, how can I tell to start copying from a certain position?): std::fstream f(inputFileName, std::fstream::in| std::fstream::binary); std::istream_iterator<unsigned char> begin(f.seekg(1024, std::ios::beg)); f << std::noskipws; std::istream_iterator<unsigned char> end; std::fstream f2(outputFi...

Inset one file inside another file after matching line
Hi all, I would like to know how to include a file in to another file at a specified location. The condition is that AWK should search for the matching pattern first and insert the contents of the file after the match. Ex: cat file1.dat line1 line2 ....... line10 cat file2.dat line21 line22 ........ line30 I would like to get an output (after the matching expression line2) like, line1 line2 line21 line22 ........ line30 line3 line4 ....... line10 with thanks and regards arun On 2/18/2011 10:37 AM, arun wrote: > > Hi all, > > I would lik...

Have a shell script check for a file to exist before processing another file
I have a shell script that runs all the time looking for a certain type of file and then it processes the file through a series of other scripts. The script is watching a directory that has files uploaded to it via SFTP. It already checks the size of the file to make sure that it is not still uploading before it starts processing. I would like to place another check in the script that looks for the existance of another file before processing begins. The script looks like: [CODE] #!/bin/ksh PATH=/gers/nurev/menu/pub/sbin:/gers/nurev/menu/pub/bin:/gers/nurev/menu/pub/mac :/gers/nurev/menu/adm/sbin:/gers/nurev/menu/adm/bin:/gers/nurev/menu/adm/mac:/ge rs/nurev/custom:/gers/nurev/fix:/gers/nurev/src_rev/fix:/gers/nurev/opt/path:/ge rs/nurev/bin:/g/bin:/usr/bin:/etc:/usr/sbin:/usr/ucb:/sbin:. ORACLE_HOME=/gers/nurev ORACLE_SID=nurev export PATH export ORACLE_HOME export ORACLE_SID # # Function : is_file_arrived file # Arg(s) : file = file to verify # Output : None # Status : 0 = yes file arrived, 1 = no # Env. : IFA_WAIT : interval (secs) for file size check (def=5) # is_file_arrived() { [ -z "$1" ] && return 1 local file=$1 local arrived=1 local size1 size2 if [ -f "$file" -a -z "$(fuser $file 2> /dev/null)" ] ; then size1=$(ls -l $file 2>/dev/null | awk '{print $5}') sleep ${IFA_WAIT:-15} size2=$(ls -l $file 2>/dev/null | awk '{print $5}') [ ${size1:-1} -eq ${siz...

Reg: Copy records from one file to another based on contents of a third file.
Hi, Suppose I have a simple flat-file, say File-C which contains just one field: Name of a person. File-A contains many records one of which is Name. Now I wish to copy all records from File-A to a new File-B only if the Name present in the record of File-A is availble in the list of Names in File-C. Can we use File Aid JCL (or Insync) to do this or any form of JCL to achieve this..?? I wish to avoid writing a cobol program which can of course achieve this. Thanks... mail_ssb@yahoo.com (ssb) wrote: >Suppose I have a simple flat-file, say File-C which contains just one >field: Nam...

Copy files using filenames from text files with shell script or bash script
How can I do this???? I have the file "lista.txt", and this file have the next information: one.txt two.txt five.txt six.txt ------------------- This files exist in the same directory that "list.txt", I would like to copy this files to other directory Using Windows the batch file would be like this: for /f "tokens=*" %i in (list.txt) do copy "%i" destdir\ How can I do something like that in REDHAT?? Best Regards On Sun, 19 Nov 2006 16:01:42 -0800, altariamx2003@gmail.com rearranged some electrons to form: > How can I do this???? > http://tldp.org/HOWTO/Bash-Prog-Intro-HOWTO.html -- David M (dmacchiarolo) http://home.triad.rr.com/redsled T/S 53 sled351 Linux 2.4.18-14 has been up 3 days 15:04 for f in `cat lisa.txt`; do cp $f /dst/dir; done -C On Nov 19, 6:43 pm, David M <NOS...@nospam.com> wrote: > On Sun, 19 Nov 2006 16:01:42 -0800, altariamx2...@gmail.com rearranged > some electrons to form: > > > How can I do this????http://tldp.org/HOWTO/Bash-Prog-Intro-HOWTO.html > > -- > David M (dmacchiarolo)http://home.triad.rr.com/redsled > T/S 53 > sled351 Linux 2.4.18-14 has been up 3 days 15:04 C.J. Steele wrote: > for f in `cat lisa.txt`; do cp $f /dst/dir; done Not a good way if you have filenames with whitespaces in lista.txt. -- js Jiri Slaby kirjoitti: > C.J. Steele wrote: > > for f in `cat lisa.txt`; do cp $f /dst/dir; done > > N...

File, Find References, Copy Files: Truncating Long File Names
Hello All- I just experienced this behavior this morning. It was repeatable. Has anyone else seen this? The file Name was cut off after 57 characters. XP Pro SP2 2006 SP0 Office XP 2003 Pro Best Regards, Devon T. Sowell www.3-ddesignsolutions.com How long was the path name in total? Total including the file extension (.SLDASM) = 174. The file Extension was retained, just the Name was chopped off. These are my customer's files. Best Regards, Devon T. Sowell www.3-ddesignsolutions.com "TOP" <kellnerp@cbd.net> wrote in message news:1128364278.638472.150320@f14g2000...

lines in file A but not in file B
Is tehre any program which will compare files A and B and list the lines in A that are not in B. The two files need not be ordered (ie the lines in A that are in B could be in a completely different order, so that diff is useless-- besides diff is too verbose since it also give context, which I do not want. In this case files A and B are unordered lists. Now I can use grep to take each item of A and see if it is in B, but that is slow, not least because I have to call grep for each item of list A. On 17 Oct 2006 15:23:12 GMT, Unruh wrote: > Is tehre any program which will compare files A...

File IO/Copy A File
I am stumped on this one... Any easy way to copy a file from a button event in RB 5.2? I basically want the button to copy DB.rdb to DB.bak. THis way is someone hozes the file, we have a backup. Thanks in advance, SJ > I am stumped on this one... > > Any easy way to copy a file from a button event in RB 5.2? I > basically want the button to copy DB.rdb to DB.bak. THis way is > someone hozes the file, we have a backup. > > Thanks in advance, > > SJ Maybe I am missing what you are trying to do - but wouldn't FolderItem.CopyFileTo d...

I cannot copy a file line by line through a thread
I have this example I am trying to build just to understand threads. The example is : the main program code prints "hello main" on the terminal. Meanwhile, a single thread is copying a file line by line. I am copying from j.txt to f.txt . All I see is that f.txt is still empty. So what should I do to make f.txt filled ? It's important that the copying works this way. I might think of skipping some lines of j.txt while it's copied to f.txt . #!/usr/bin/tclsh package require Thread set thread1 [ thread::create ] set fid [ open "j.txt" "r" ] thread::transfer $thread1 $fid set script2 { set cp [open "f.txt" "a" ] while { [ gets $fid line] } { puts $cp $line } } thread::send -async $thread1 [list set fid $fid ] thread::send -async $thread1 $script2 while true { puts "hello main"; after 2000 } Am 24.10.13 09:37, schrieb Rani Ahmad: > I have this example I am trying to build just to understand threads. > The example is : the main program code prints "hello main" on the terminal. Meanwhile, a single thread is copying a file line by line. > I am copying from j.txt to f.txt . > All I see is that f.txt is still empty. So what should I do to make f.txt filled ? > It's important that the copying works this way. I might think of skipping some lines of j.txt while it's copied to f.txt . > > #!/usr/bin/tclsh > package require Thread > &g...

Condensing a .csv file into another .csv file via executing/calling a file..
How could I get started on a project that executes upon calling it..taking 1 csv file in location A and computes average etc.. and then exports it to a new csv file in another location B? Would this be an exe file that does it? Does VBasic create exe files? Thanks! On 22 Jan 2007 11:02:06 -0800, redrosekrs@yahoo.com wrote something that piqued my interest enough to reply with: >How could I get started on a project that executes upon calling >it..taking 1 csv file in location A and computes average etc.. and then >exports it to a new csv file in another location B? Would this be an >exe file that does it? Does VBasic create exe files? Thanks! A lot will depend upon how your data is laid out, is the layout static, how much data are you going to have to process, etc. A CSV is just a text file formatted in a particular way so you could start by selecting the input file, reading the file in and parsing the elements into data arrays, computing your required outputs from that data, then writing it out to a new CSV file. You may also want to consider if the task can be more easily implemented in Excel or Access as they allow you to link to CSV files and treat them like spreadsheets/tables. Excel/Access are designed to handle such tabulated data and already have the functions/reporting options for the type of output that you may require. -- Alfie [UK] <http://www.delphia.co.uk/> It's not hard to meet expenses, they're everywhere. Well instead of link...

Simple shell Script to copy file from one location to another
Hello people I am new to this group and wondering if any one has a simple script which copies the file from one location to another location on the same server. Thanks -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Mehdi wrote: > Hello people > > I am new to this group and wondering if any one has a simple script > which copies the file from one location to another location on the same > server. The simplest way is to use the cp(1) command. Are you certain that you want a script for this? - -- Lew Pitcher, IT Specialist, Corporate Technology Solutions, Enterprise Technology Solutions, TD Bank Financial Group (Opinions expressed here are my own, not my employer's) -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFEBeR1agVFX4UWr64RAipiAJ4sLeMlxZUA6NgphN59y3VFRZKsRACfarbO 8cWcJaG/UkSopZkGxdI2uDM= =ihP4 -----END PGP SIGNATURE----- >I am new to this group and wondering if any one has a simple script >which copies the file from one location to another location on the same >server. What about the 'cp' command isn't sufficient for your purposes? Most systems have more than a single "THE file". And if you're intending to copy it, you'll end up with at least 2 files. Gordon L. Burditt ...

copy txt file - only copies 1/3 of the file
File.open('oldFile.txt', 'r') do |f1| #file contains XML type data m = f1.gets File.open('newFile.txt','w') do |f2| #newFile to separate data in oldFile f2.puts m.split("<") end end Hello All. There is something that I did that was weird here. I say this because when I open the new file that it creates its 1/3 the size of the original. It seems to just completely cut off. I took off the .split and it still did this, so I know it has nothing to do with split. What do you think is going on? oldFile.txt contains XML formatted data. ...

file extention from file file location
Hi, I am new to perl (only working on this one problem) but I program in other languages. We have an upload script written in cgi. Can anyone tell me how to get the file extension from the variable $File1 (actual file location on uploader's computer) then find out if it is equal to "txt" Thanks in advance for not telling me to read the manual. Ron -- PLEASE NOTE: comp.infosystems.www.authoring.cgi is a SELF-MODERATED newsgroup. aa.net and boutell.com are NOT the originators of the articles and are NOT responsible for their content. HOW TO POST to co...

Unix help required: one line comand to date Column to a fixed length file parsing the file name
Hi , I have a fixed length file of records size 50 , file_nm.YYYYMMDD.dat . My requirement is that : To parse the file name for date and add the apped this date to the end of each record . After this the resultant record size becomes 58 . Is there one line command with AWK /SED i can make use for this purpose . Thanks in Advance , Ajay ajay.balki wrote: > Hi , > > I have a fixed length file of records size 50 , > file_nm.YYYYMMDD.dat . > My requirement is that : To parse the file name for date and add the > apped this date to the end of each record . > > Aft...

Read file line by line, but the file was store as a BLOB on SQL DB
Hi Experts, I have a large text file which was store as a BLOB on SQL Server. Each line of this file is terminated by a vbCrLf. For example, + 03 0F 0F EDCDLL_908 DLL 1400 7457 1CB2 1CB2 * 031400 C2 AF 75 EB 00 90 80 11 74 0F 43 BE 01 F0 15 82 031410 E4 12 00 34 12 14 17 C0 E0 C0 F0 C0 83 C0 82 C0 031420 D0 D2 D3 75 EB 00 90 80 11 74 0F 43 BE 01 F0 15 .... Now, I need to read this file "line by line". Of course I can retrieve the whole file, save it into local drive, then open and read it with "Open...Input...", then kill it and go for the next. But working this way is quite impossible since my program is extremely "time-critical". Every millisecond is a big thing to me. Is these any smart way doing it? Thanks. Yan. "Yan" <ky.mo@spectratech.com> wrote in message news:co6hb9$6mv$1@nnews.pacific.net.hk... > Hi Experts, > > I have a large text file which was store as a BLOB on SQL Server. Each line > of this file is terminated by a vbCrLf. For example, > > + > 03 0F 0F EDCDLL_908 DLL 1400 7457 1CB2 1CB2 > * > 031400 C2 AF 75 EB 00 90 80 11 74 0F 43 BE 01 F0 15 82 > 031410 E4 12 00 34 12 14 17 C0 E0 C0 F0 C0 83 C0 82 C0 > 031420 D0 D2 D3 75 EB 00 90 80 11 74 0F 43 BE 01 F0 15 > ... > > Now, I need to read this file "line by line". Of course I can retrieve the > whole file, save it into local drive, then open and read it with > "Open...Input...", then kill it ...

python copy selected lines from one file to another using argparse or getopt
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 the word "abc", then the code will only copy the lines which has "exception" in it but not "abc"). Now all the work will be done from the command prompt. The input would be: file.py test.txt(input file) test_mod.txt(output file) -e abc(exclude word ...

Web resources about - copying nth line from a file to another file - comp.unix.shell

Private copying levy - Wikipedia, the free encyclopedia
A private copying levy (also known as blank media tax or levy ) is a government -mandated scheme in which a special tax or levy (additional to ...

Zynga CEO Dispels Facebook Game Copying Accusations
... they are like the crew mechanic in our games. They give you a new way to interact with your friends. Zynga was also accused last week of copying ...

Showing Apple employee #8 some of my artifacts. He remembers manually copying the Star Wars cassettes ...
jurvetson posted a photo: He has a rig that fed eight recoding tape drives from one master, and he would manually copy eight tapes at a time ...

The Secret Pattern That Stops You Copying Bank Notes - YouTube
http://tomscott.com - @tomscott - There's a hidden pattern on banknotes, all around the world, that means photocopiers refuse to copy them.

CSAIL fixes software bugs automatically, in any language, by copying from safer applications
A new system can repair bugs in software using smart processing that imports functionality from other programs, all without access to source ...

Risk of other countries copying boat turn-backs low: UN High Commissioner for Refugees
The risk that other countries will copy Australia's hardline asylum seeker policies is low, the United Nations High Commissioner for Refugees ...

Hardware vendors sue Dutch government over copyright levies - regulation, legal, Dutch Home Copying Foundation ...
... on hard disks, smartphones, tablets and MP3 players that are meant to compensate the music and movie industries for losses caused by home copying. ...

Grace Jones slams Lady Gaga for copying her, describes her as soulless - The Courier-Mail Search Search ...
GRACE Jones has slammed Lady Gaga in a new interview, saying she didn’t “feel a soul” when she met the controversial pop star.

Iran claims to be copying US drone
CTV.ca Iran claims to be copying US drone Herald Sun AN IRANIAN military commander said the country is building a copy of a US spy drone captured ...

Ex-cop pleads guilty to copying sex video
A former officer has pleaded guilty to copying a private sex video he found on the mobile phone of a victim who came to police for help last ...

Resources last updated: 3/29/2016 1:42:42 AM