Sponsored Content
Top Forums Shell Programming and Scripting Hello - Have a big issue need help please ASAP Post 302510613 by mnassiri on Monday 4th of April 2011 12:43:57 PM
Old 04-04-2011
Hello - Have a big issue need help please ASAP

I have been using this simple grep command to extract fields from a file that ALPHANUMERIC field has been set to 16
Code:
grep  -w 'ALPHANUMERIC     *16'  filename

------------------------- sample data file
Code:
SAMP_RICS  "SAMPLE RICS"        5694  NULL        ALPHANUMERIC       60  RMTES_STRING    60
PROB_DESC  "PROBLEM DESC"       5695  NULL        ALPHANUMERIC       32  RMTES_STRING    32
PAIR_CLIP1 "PAIR CLIP1"         5702  NULL        ALPHANUMERIC        9  RMTES_STRING     9
RELDATA1   "RELATED DATA1"      5756  NULL        ALPHANUMERIC       16  RMTES_STRING    16
RELNEWS    "RELATED NEWS"       5757  NULL        ALPHANUMERIC       16  RMTES_STRING    16
RELDATA2   "RELATED DATA2"      5758  NULL        ALPHANUMERIC       21  RMTES_STRING    21

--------------------------------------------

What I need to do is to extract everyline where the ALPHANUMERIC is set t to 28 and higher? betweem 28 & 255 t obe exact
I tried this shell script but it is not working. The grep command fails
because $c is not interperted ..
I tried escape character and it did not work


Anyone can help me with a simple shell command to extract all lines where the ALPHANUMERIC is set to 28 or higher?
Code:
#!/bin/bash

c=28
while [ $c -ge 28 ]  ; [ $c -le 255 ]
do
        grep -w 'ALPHANUMERIC     $c' RDMFieldDictionary
        (( c++ ))
done

~


------------------- Question --??


Anyone can help me with a simple shell command to extract all lines where the ALPHANUMERIC is set to 28 or higher in this file?

Last edited by Franklin52; 04-04-2011 at 02:09 PM.. Reason: Please use code tags
 

8 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

How to view a big file(143M big)

1 . Thanks everyone who read the post first. 2 . I have a log file which size is 143M , I can not use vi open it .I can not use xedit open it too. How to view it ? If I want to view 200-300 ,how can I implement it 3 . Thanks (3 Replies)
Discussion started by: chenhao_no1
3 Replies

2. Shell Programming and Scripting

need help asap

i have a file having content a|b|c 1|2|33 4|6|55 end a|b|d 3|4|55 end a|b|c 45|67|98 end so i want to print 3rd field of header a|b|c and footer end. e.g. o/p should be 33 55 98 (7 Replies)
Discussion started by: manas_ranjan
7 Replies

3. Shell Programming and Scripting

need help asap!

Hello everyone, I'm new to using Linux and i am trying to create a script that will produce a list of all the files of the present working directory. So far I only have this #!/bin/bash cd / ls -lt>> I can't figure out what I am suppose to do next. (6 Replies)
Discussion started by: reecygee
6 Replies

4. UNIX for Dummies Questions & Answers

How big is too big a config.log file?

I have a 5000 line config.log file with several "maybe" errors. Any reccomendations on finding solvable problems? (2 Replies)
Discussion started by: NeedLotsofHelp
2 Replies

5. Homework & Coursework Questions

PLEASE HELP ME ASAP

can anyone help me with this??? make program ( shell script) to detect and display errors occurred in initializing a Unix system (4 Replies)
Discussion started by: dementor
4 Replies

6. Red Hat

NFS4 Mount issue - ASAP

Hi, I am trying to mount via nfs4 # mount -t nfs4 10.1.56.16:/Apps /works/apps/xyz Error: Warning rpc.idmapd apperas not to be running all uids will be mapped to the nobody uid mount to NFS server "10.1.56.16' failed RPC error: program/version mismatched pls help - this is coming... (1 Reply)
Discussion started by: saurabh84g
1 Replies

7. Solaris

Big /etc/group creating issue

I have Solaris-10 with kernel patch 142900-03, Update 7 Sparc server. root@ddlomps40:/# uname -a SunOS ddlomps40 5.10 Generic_142900-03 sun4u sparc SUNW,SPARC-Enterprise root@ddlomps40:/# cat /etc/release Solaris 10 5/09 s10s_u7wos_08 SPARC Copyright 2009 Sun... (5 Replies)
Discussion started by: solaris_1977
5 Replies

8. Shell Programming and Scripting

Delete big directory issue

Hello folks, I am deleting a directory with script it is taking 11Hour and also increase the IO on server. I am using below command, inside date directory there are hour directories, which i am deleting after archiving. Archiving is not taking long time, only "rm -rf" is taking alot of time with... (21 Replies)
Discussion started by: learnbash
21 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 07:02 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy