Sponsored Content
Top Forums Shell Programming and Scripting help with grep command or other useful command Post 302159188 by amm on Thursday 17th of January 2008 07:10:00 AM
Old 01-17-2008
Hi again

I have discovered the problem some how exactly.

As I mentioned Above, the representation of the digit number in Minutes is the key word for solving this problem. For example, the digit number for the first line is 9.21 NOT 09.21, and the same for the last line, is 8.88 NOT 08.88.
Thats why the coding dosen't want to go throw the calculation for those lines.

Any Idea how to solve this small problem?

Otherwise, any Idea on how to search for it inside the file(Inputfile in this case), and fix it manually by adding ZERO "0"..?

Last output file:
Quote:
960109 914 4.54 25 9.21 40-50.34 14.83 2.81 12 335116.5 0.26 6.8 81.7 D1
940129 559 37.02 24.4822 39.8632 0.86 1.99 17 151 9.0 0.07 0.2 0.4 B1
940130 1047 38.93 24.8982 40.7385 9.52 2.89 20 321 93.9 0.17 1.6 28.7 D1
940131 843 37.78 24.8923 40.768 5.19 2.88 17 322 96.4 0.21 15.9 49.9 D1
951106 732 56.83 24.7907 40.437 5.08 2.66 15 307 61.2 0.18 5.3 15.6 D1
951107 6 3 23.22 24.5112 39-56.35 5.68 1.85 8 222 7.6 0.11 1.5 1.4
951107 912 4.16 24.8515 40.6905 10.00 2.66 9 328 87.4 0.02 0.3 4.2 C1
951108 554 20.09 25 8.88 41-15.85 10.00 2.94 7 339153.6 0.14 5.2211.8 D1
Another problem, it seems that the calculation won't go for all the digit numbers. Mean that, he do skip some arbitrary numbers like this one, 24.5112 39-56.35 , he calculate the first one but, he didn't for the second...?? strange...!!

Any Idea and help are very much appreciate it..

Thanks
Amm
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

grep command

Hi, how to search all occurance of keyword in current directory files and sub folder's files also using grep command. thanks (2 Replies)
Discussion started by: avadhani
2 Replies

2. UNIX for Advanced & Expert Users

how to exclude the GREP command from GREP

I am doing "ps -f" to see my process. but I get lines that one of it represents the ps command itself. I want to grep it out using -v flag, but than I get another process that belongs to the GREP itself : I would like to exclude # ps -f UID PID PPID C STIME TTY TIME CMD... (2 Replies)
Discussion started by: yamsin789
2 Replies

3. Shell Programming and Scripting

Help me on Grep Command

Hi, Can anybody explain me about the below mentioned code. grep "^" $FILENAME | cut -c 1-8,84- | awk '{ if (!($2+$3)) printf $1 "," }' >$TEMP_FILENAME Thanks in advance. (3 Replies)
Discussion started by: Kattoor
3 Replies

4. Shell Programming and Scripting

can anyone help with shell script command about searching word with grep command?

i want to search in the current directory all the files that contain one word for example "hello" i want to achieve it with the grep command but not with the grep * (2 Replies)
Discussion started by: aintour
2 Replies

5. Shell Programming and Scripting

Grep Command

Hi, I Want to grep the 500th character of a line in a file. please help on this. Thanks in advance (7 Replies)
Discussion started by: raghulshekar
7 Replies

6. UNIX for Dummies Questions & Answers

grep command - help

I need to find the word "who" in a file but only that word. For instance I don't want it to find the word "whoever." Any suggestions? (2 Replies)
Discussion started by: brooksie91
2 Replies

7. Shell Programming and Scripting

Help with using grep command with copy command

Hi, im taking an entry Unix class, and as part of my lab assignment I have to copy all files in the /home/david/lab3 directory that have the file extension .save to your lab3/temp directory. I'm having trouble getting the grep to do anything worth while I've been trying to do: cp... (6 Replies)
Discussion started by: Critical jeff
6 Replies

8. Shell Programming and Scripting

help with grep command

i have a file which lists the following T2323 T3445 T67666,T6534,T4546 T7878 i need to extract the numeric part only(ie,without T). i tried this script awk '{print substr($0,2,length($0))}' pmt2.txtOutput 2323 3445 67666,T6534,T4546as u can see the numbers coming after "," remains the... (2 Replies)
Discussion started by: born
2 Replies

9. Shell Programming and Scripting

help with grep command

i have the following lines T2345 T3435 - bugfixed and running T5654 fixed and committed T34541:- fixed and committed i need to extract only the T part (eg:T2345) ,ie i dont want any special characters after it. i have been trying with grep and egrep but with no luck. pls help (11 Replies)
Discussion started by: born
11 Replies

10. Shell Programming and Scripting

Grep command giving different result for different users for same command

Hello, I am running below command as root user #nodetool cfstats tests | grep "Memtable switch count" Memtable switch count: 12 Where as when I try to run same command as another user it gives different result. #su -l zabbix -s /bin/bash -c "nodetool cfstats tests | grep "Memtable switch... (10 Replies)
Discussion started by: Pushpraj
10 Replies
ZGREP(1)                                                      General Commands Manual                                                     ZGREP(1)

NAME
zgrep - search possibly compressed files for a regular expression SYNOPSIS
zgrep [ grep_options ] [ -e ] pattern filename... DESCRIPTION
Zgrep invokes grep on compressed or gzipped files. These grep options will cause zgrep to terminate with an error code: (-[drRzZ]|--di*|--exc*|--inc*|--rec*|--nu*). All other options specified are passed directly to grep. If no file is specified, then the standard input is decompressed if necessary and fed to grep. Otherwise the given files are uncompressed if necessary and fed to grep. If the GREP environment variable is set, zgrep uses it as the grep program to be invoked. EXIT CODE
2 - An option that is not supported was specified. AUTHOR
Charles Levert (charles@comm.polymtl.ca) SEE ALSO
grep(1), gzexe(1), gzip(1), zdiff(1), zforce(1), zmore(1), znew(1) ZGREP(1)
All times are GMT -4. The time now is 09:45 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy