05-05-2010
thanks Franklin......the code worked....i wish i knew it was so easy to combine both with the && in between.....thanks a lot
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi everybody:
Could anybody tell me how I can print from a file a selected rows with awk. In my case I only want print in another file all the rows from NR=8 to NR=2459 and the increment each 8 times.
I tried to this:
awk '{for (i=8; i=2459; i+=8); NR==i}' file1 > file2
But doesn't... (6 Replies)
Discussion started by: tonet
6 Replies
2. Shell Programming and Scripting
Hi everybody:
I try to print in new file selected lines from another file wich depends on the first column.
I have done a script like this:
lines=( "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "21" "31" "41" "51" "55" "57" "58" )
${lines}
for lines in ${lines}
do
awk -v ... (6 Replies)
Discussion started by: tonet
6 Replies
3. UNIX for Dummies Questions & Answers
I have a large file and want to print out, but I don't want to print all, just some pages. Like if the file has 100 pages, I just want to print out page 3-34 and 67-87. How can I do?
By the way, I already try "lp -o page-ranges=value" command which doesn't work on my computer because -o <option>... (2 Replies)
Discussion started by: wendyz
2 Replies
4. Shell Programming and Scripting
Hi Experts,
The question may look very silly by seeing the title, but please have a look at it clearly.
I have a text file where the first 5 columns in each row were supposed to be attributes of a sample(like sample name, number, status etc) and the next 25 columns are parameters on which... (3 Replies)
Discussion started by: ks_reddy
3 Replies
5. Shell Programming and Scripting
Hello.
I face this (2 side) problem.
Some lines with this structure.
...........
12345678 4
12345989 13
12346356 205
12346644 74
12346819 22
.........
The first field (timestamp) is growing (or at least equal).
1)Sum the second fields if the first_field/500 are... (8 Replies)
Discussion started by: paolfili
8 Replies
6. Shell Programming and Scripting
I need to extract selected lines from a log file, I can use grep to pull one line matching 'x' or matching 'y', how can I run through the log printing both matching lines in order top to bottom.
i.e
line 1 xyz - not needed
line 2 User01 - needed
line 3 123 - not needed
line 4 Info - needed... (2 Replies)
Discussion started by: rosslm
2 Replies
7. Shell Programming and Scripting
Hi guys!
I'm new to scripting and I need to write a script in awk.
Here is example of file on which I'm working
ATOM 4688 HG1 PRO A 322 18.080 59.680 137.020 1.00 0.00
ATOM 4689 HG2 PRO A 322 18.850 61.220 137.010 1.00 0.00
ATOM 4690 CD ... (18 Replies)
Discussion started by: grincz
18 Replies
8. Shell Programming and Scripting
HI,
I am using below command to display the words, but i am getting awk error. Please help me out on this
I am using below code
i am getting error as
If i use below code i am getting below OP
Output from where i am trying to select the fields after delimiter ","
from here i want to... (5 Replies)
Discussion started by: darling
5 Replies
9. Shell Programming and Scripting
Dear All,
I have a data file input.csv like below. (Only five column shown here for example.)
Data1,StepNo,Data2,Data3,Data4
2,1,3,4,5
3,1,5,6,7
3,2,4,5,6
5,3,5,5,6
From this I want the below output
Data1,StepNo,Data2,Data3,Data4
2,1,3,4,5
3,1,5,6,7
where the second column... (4 Replies)
Discussion started by: ks_reddy
4 Replies
10. Shell Programming and Scripting
Hi,
I need help on a complicated file that I am working on. I wanted to extract important info from a very huge file. It is space delimited file. I have hundred thousands of records in this file. An example content of the inputfile as below:-
##
ID Ser402 Old; 23... (2 Replies)
Discussion started by: redse171
2 Replies