Sponsored Content
Full Discussion: grep from file
Top Forums Shell Programming and Scripting grep from file Post 302184054 by jaydeep_sadaria on Thursday 10th of April 2008 11:31:05 AM
Old 04-10-2008
grep from file

hi all

I am using below mention file as input file. Now i want to grep only contain between BSCANGR( op mention below). line containg between BSCANGR may be vary its not fix.

Kindly suggest me.


*** BSCANGR
RXOTRX-280-1 INTERNAL
RXOTRX-48-2 MODE
RXOTRX-48-3 MODE
RXOTRX-194-11 MODE
RXOTRX-194-10 MODE
RXOTRX-147-0 INTERNAL
*** BSCANGR
*** BSCSLP2
RXOTRX-20-1 INTERNAL
RXOTRX-4-2 MODE
RXOTRX-4-3 MODE
RXOTRX-14-11 MODE
RXOTRX-14-10 MODE
RXOTRX-17-0 INTERNAL
*** BSCSLP2


op need to like this:

*** BSCANGR
RXOTRX-280-1
RXOTRX-48-2
RXOTRX-48-3
RXOTRX-194-11
RXOTRX-194-10
RXOTRX-147-0
*** BSCANGR


also i am thank full if some one suggest for below mention op.from same file.

@ CONNECT('BSCANGR')
RXCDP:RXOTRX-280-1;
RXCDP:RXOTRX-48-2
RXCDP:RXOTRX-48-3
RXCDP:RXOTRX-194-11
RXCDP:RXOTRX-147-0
@ DISCONNECT
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

grep for certain files using a file as input to grep and then move

Hi All, I need to grep few files which has words like the below in the file name , which i want to put it in a file and and grep for the files which contain these names and move it to a new directory , full file name -C20091210.1000-20091210.1100_SMGBSC3:1000... (2 Replies)
Discussion started by: anita07
2 Replies

2. Shell Programming and Scripting

Grep pattern from different file and display if it exists in the required file

Hi, I have two files say xxx.txt and yyy.txt. xxx.txt is with list of patterns within double quotes. Eg. "this is the line1" "this is the line2" The yyy.txt with lot of lines. eg: "This is a test message which contains rubbish information just to fill the page which is of no use. this is... (3 Replies)
Discussion started by: abinash
3 Replies

3. Shell Programming and Scripting

script to grep a pattern from file compare contents with another file and replace

Hi All, Need help on this I have 2 files one file file1 which has several entries as : define service{ hostgroup_name !host1,!host5,!host6,.* service_description check_nrpe } define service{ hostgroup_name !host2,!host4,!host6,.* service_description check_opt } another... (2 Replies)
Discussion started by: namitai
2 Replies

4. Shell Programming and Scripting

Shell Script to grep Job File name and Log File name from crontab -l

Hello, I am new to shell scripting. I need to write a shell script where i can grep the name of file ie. .sh file and log file from crontab -l. #51 18 * * * /home/oracle/refresh/refresh_ug634.sh > /home/oracle/refresh/refresh_ug634.sh.log 2>&1 #40 17 * * * /home/oracle/refresh/refresh_ux634.sh... (1 Reply)
Discussion started by: guptra
1 Replies

5. Shell Programming and Scripting

Diff between grep .* file name and grep '.*' filename

Hi, Can anyone let me know what is difference between grep .* foo.c grep '.*' foo.c I am not able to understand what is exact difference. Thanks in advance (2 Replies)
Discussion started by: SasDutta
2 Replies

6. UNIX for Dummies Questions & Answers

Grep? - using a file of terms to search another file when the information is on a different line

I have a flat file that looks like this, let's call it Chromosome_9.txt: FT /Gene_Name="Guanyl-Acetylase 9" FT /Gene_Number"36952" FT /Gene_Name="Endoplasmic Luciferase" FT /Gene_Number"36953" FT ... (4 Replies)
Discussion started by: Twinklefingers
4 Replies

7. Shell Programming and Scripting

How to grep a log file for words listed in separate text file?

Hello, I want to grep a log ("server.log") for words in a separate file ("white-list.txt") and generate a separate log file containing each line that uses a word from the "white-list.txt" file. Putting that in bullet points: Search through "server.log" for lines that contain any word... (15 Replies)
Discussion started by: nbsparks
15 Replies

8. Shell Programming and Scripting

Inconsistent `ps -eaf -o args | grep -i sfs_pcard_load_file.ksh | grep -v grep | wc -l`

i have this line of code that looks for the same file if it is currently running and returns the count. `ps -eaf -o args | grep -i sfs_pcard_load_file.ksh | grep -v grep | wc -l` basically it is assigned to a variable ISRUNNING=`ps -eaf -o args | grep -i sfs_pcard_load_file.ksh |... (6 Replies)
Discussion started by: wtolentino
6 Replies

9. Shell Programming and Scripting

Grep a log file starting from a specific time to the end of file

I have a log file which have a date and time at the start of every line. I need to search the log file starting from a specific time to the end of file. For example: Starting point: July 29 2018 21:00:00 End point : end of file My concern is what if the pattern of `July 29 2018 21:00:00`... (3 Replies)
Discussion started by: erin00
3 Replies

10. UNIX for Beginners Questions & Answers

Grep: Retrieve two strings from one file to find them anyone on line in another file

I am having trouble matching *two* strings from one file anywhere in a line of a second file, and could use some help getting this figured out. My preference would be to use grep for this because I would like to take advantage of its -A option. The latter is due to the fact that I would like both... (2 Replies)
Discussion started by: jvoot
2 Replies
sparkformat(1)															    sparkformat(1)

NAME
sparkformat - pretty-prints SPARK annotations SYNOPSIS
sparkformat [OPTIONS] [ FILE_LIST or @METAFILE ] DESCRIPTION
This manual page only summarises the sparkformat command-line flags, please refer to the full SPARKFormat manual for further information. OPTIONS
These options do not quite follow the usual GNU command line syntax. All options start with a single dash instead of the usual two and they can also be abbreviated, as long as the abbreviation is unique. For example -expand can be abbreviated to -expa but not -exp as this clash- es with -export_indent. -help Display command-line help. -version Display version information. -add_modes, -noadd_modes Add modes to unmoded global variables. By default we do not do this. -annotation_character=CHAR Select alternative annotation character. The default is '#'. -compress, -expand Comress or expand the dependency relations. The default is to compress. -default_function_modes=MODE When used in conjunction with -add_modes, force global variables of functions to the specified default function mode. The available default function modes are 'in_mode' and 'unmoded', and may be abbreviated to 'i' and 'u' respectively. -export_indent=MODE, -global_indent=MODE, -import_indent=MODE, -inherit_indent=MODE, -initialization_indent=MODE, -own_indent=MODE, -sepa- rator_indent=MODE, -properties_indent=MODE Specifies the degree of indentation from '--#' or keeps them inline (the default). MODE can be either a number or 'inline'. SEE ALSO
spark(1), sparksimp(1), spadesimp(1), zombiescope(1), victor(1), pogs(1) sparkmake(1) AUTHOR
This manual page was written by Florian Schanda <florian.schanda@altran-praxis.com> for the Debian GNU/Linux system (but may be used by others). Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Ver- sion 1.3 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts and no Back-Cover Texts. 22 March 2011 sparkformat(1)
All times are GMT -4. The time now is 01:54 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy