04-29-2006
hey thanks for ur reply yaar
hey i got the solution to the above problem.
i used the sed command sed -n " $L1,$L2 w outfile" inputfile where L1 and L2 are variables which contains line numbers.
previously i used the same command but with ' qoutes instead of " quotes.
Any have thanks for showing interest to solve my problem
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
i got a data file which contains all the pid,ppid,user,command,pcpu,start_time,status. I wanted to display out the pcpu which is greater than 0.
i uses awk'{if($5 > 0){print}}' filename.txt but is printing out result which not i wanted. Is there any way which i can print out those pcpu which is... (8 Replies)
Discussion started by: thms_sum
8 Replies
2. Shell Programming and Scripting
Hi ALL,
I want to print lines from file using certain conditions
for exmple:
# The following commands will create a new control file and use it
# to open the database.
# The contents of online logs will be lost and all backups will
# be invalidated. Use this only if online logs are... (25 Replies)
Discussion started by: jack00423
25 Replies
3. Windows & DOS: Issues & Discussions
Hi
I want to print lines 20-30 from a file.
In UNIX , this command will work
sed -n '20,30p' file
However what is the equivalent command in DOS ?
Pls help me ! (2 Replies)
Discussion started by: dashing201
2 Replies
4. Shell Programming and Scripting
Hi all,
This should be very easy but I can't figure it out...
I have a file that looks like this:
@SRR057408.1 FW8Y5CK02R652T length=34
AGCAGTGGTATCAACGCAGAGTAAGCAGTGGTAT
+SRR057408.1 FW8Y5CK02R652T length=34
FIIHFF6666?=:88@@@BBD:::?@ABBAAA>8
@SRR057408.2 FW8Y5CK02TBMHV length=52... (1 Reply)
Discussion started by: kmkocot
1 Replies
5. Shell Programming and Scripting
Hi,
I have two files. 1st file has 1 column (huge file containing ~19200000 lines) and 2nd file has 2 columns (small file containing ~6000 lines).
#################################
huge_file.txt
a
a
ab
b
##################################
small_file.txt
a 1.5
b 2.5
ab ... (4 Replies)
Discussion started by: AshwaniSharma09
4 Replies
6. Shell Programming and Scripting
Hi,
I have one file, say file 1, that has data like below where 19900107 is the date,
19900107 12 144 129 0.7380047
19900108 12 168 129 0.3149017
19900109 12 192 129 3.2766666E-02
... (3 Replies)
Discussion started by: Wynner
3 Replies
7. UNIX for Dummies Questions & Answers
Hello I am a new unix user, and I have a work related task to compare 2 files and print all of the lines in file 2 that contain a string from file 1 Note: the fields are in different columns in the files. I suspect the is a good use for awk? Thanks for your time & help
File 1
123 232 W343... (6 Replies)
Discussion started by: KevinRidley
6 Replies
8. Shell Programming and Scripting
my script so far
nawk -F, 'NR==FNR{a++;next} a{b++}
END{for(i in b){if(b-1){print i";\t\t"b}else{print "NEW:"i";\t\t1"} } }' OFS=, 20111228.csv *.csv | sort
NE:221478,SHELF:13,SLOT:4; 2
NE:221726,SHELF:8,SLOT:1; 2
NE:222318,SHELF:14,SLOT:1; 9... (20 Replies)
Discussion started by: llcooljatt
20 Replies
9. Shell Programming and Scripting
I have a file that needs 1st line, 2nd line, and 26th line printed from every chunk of data. Each chunk of data contains 26 lines (#line+%line+24 data lines = 26 lines of data repeated).
Input file:
# This is a data file used for blockA (chunk 1).
% 10576 A 10 0 1
04 (data1)
03 (data2)... (2 Replies)
Discussion started by: morrbie
2 Replies
10. Shell Programming and Scripting
Dear friends,
I am just trying to print data from 2 file,namely file_1.txt and file_1.dat (specific column of ROW 1)
file_1.txt
12 13 14 15 99 AMC 69 36 89
12 13 14 15 99 AMC 69 84 -12
12 13 14 ... (6 Replies)
Discussion started by: nex_asp
6 Replies
factor(1) General Commands Manual factor(1)
NAME
factor, primes - factor a number, generate large primes
SYNOPSIS
[number]
[start[stop]]
DESCRIPTION
If no arguments are provided on the command line, waits for a number to be typed in. If a positive number is typed, it factors the number
and print its prime factors; each one is printed the proper number of times. It then waits for another number. exits if it encounters a
zero or any non-numeric character.
If an argument is provided on the command line, factors the number as above, then exits.
Maximum time to factor is proportional to sqrt(n) and occurs when n is prime or the square of a prime.
The largest number that can be dealt with by is 1.0e14.
prints prime numbers between a lower and upper bound. If no arguments are provided on the command line, waits for two numbers to be typed
in. The first number is interpreted as the lower bound; the second as the upper bound. All prime numbers in the resulting inclusive range
are printed.
If start is specified, all primes greater than or equal to start are printed. If both start and stop are given, all primes occurring in
the inclusive range start through stop are printed.
start and stop values must be integers represented as long integers.
If the stop value is omitted in either case, runs either until overflow occurs or until it is stopped by typing the interrupt character.
The largest number that can be dealt with by is 2,147,483,647.
DIAGNOSTICS
Both commands print when the input is out of range, illegal characters are encountered, or when start is greater than stop.
EXAMPLES
Print the prime factorization for the number 12:
Print all prime numbers between 0 and 20:
factor(1)