Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Please help me in taking the values from a file Post 302223449 by jin on Sunday 10th of August 2008 10:48:30 AM
Old 08-10-2008
Question how to take a value which comes above the search string

tht has been resolved.. any way thaks for your reply. i have another query.

I have a file , which having the following out put

insert_job: PS_PositivePayBox job_type: b
insert_job: PS_PositivePay_MOBox job_type: b
insert_job: PS_PositivePay_MO_norun job_type: c
owner: bosuser

insert_job: PS_PositivePay_MO_Watch job_type: f
insert_job: PS_Wait_MO job_type: c
owner: bosuser

insert_job: PS_Fetch_MO job_type: c
insert_job: PS_Notify_MO job_type: c
owner: bosuser

insert_job: PS_PositivePay_BWBox job_type: b
insert_job: PS_PositivePay_BW_norun job_type: c
owner: bosuser
insert_job: PS_PositivePay_BW_Watch job_type: f

I need to find all the insert_job line, which comes above owner: bosuser

For eg.

insert_job: PS_PositivePay_BW_norun job_type: c
owner: bosuser

I need the , “ insert_job: PS_PositivePay_BW_norun job_type: c”

What can be the command
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

taking a part from file name

hi i have a file with name "CT_Thread_Trace.384.20080728-121217.log" i need 384 , can any one help thanks Satya (5 Replies)
Discussion started by: Satyak
5 Replies

2. Shell Programming and Scripting

Taking a particular attribute's value in a file...

HI, Iam new to scripting..I need some guidance for invoking the following logic.. My input file contains Event Time = Thu, Nov 6, 2008 08:41:56 AM Probable Cause = UnspecifiedReason Specific Problems = BTS down due to Tx ... (16 Replies)
Discussion started by: Llb
16 Replies

3. Shell Programming and Scripting

taking the Log2 values

Hi, I am able to take the log value for the third column of a file using the script below. But I want to take the log2 (not the log). How would I write that? thanks awk 'BEGIN {OFS="\t"} {print $1, $2, log ($3)}' (2 Replies)
Discussion started by: kylle345
2 Replies

4. Shell Programming and Scripting

How to ftp multiple files by taking the file name from a input file.

Hi, I'm working on a script which has to copy multiple files from one server to another server. The list of files that are to be copied is present in a file say input.txt. vi input.txt abc.c welcome.c new.c welcome1.c for ftp'ing a single file say 'new.c' the following code... (2 Replies)
Discussion started by: i.srini89
2 Replies

5. Shell Programming and Scripting

Taking sum up all values inside the file

Hi, Taking sum up all values inside the file by using the below command: paste -sd+ filenmae | bc Getting some error like "0705-001: building space exceeded on line1 stdin" The original data looks like SPACE SPACE SPACE 0.123 JOBNAME1 SPACE SPACE 20.325 JOBNAME2 SPACE SPACE... (2 Replies)
Discussion started by: NareshN
2 Replies

6. Shell Programming and Scripting

Installing a bin file by taking input from a properties file

I need to install a bin file in UNIX which requires user interaction for giving some information like user id , path, sid etc. All these information is stored in a properties file in the same location. So if i give ./file.bin -f propfile.properties will it install the file taking all the... (1 Reply)
Discussion started by: coolmohere
1 Replies

7. UNIX for Dummies Questions & Answers

Taking word count from file and printing in file

hi, i am having a file which contains the below content, i need to take the word count of if and print the file name also inputfile.txt file_name1.txt,type_name1.txt file_name2.txt,type_name2.txt i would need the word count of the files like this if file_name*.txt then wc -l... (10 Replies)
Discussion started by: rohit_shinez
10 Replies

8. Shell Programming and Scripting

Replace from taking from file

Hi, I have one file. S_CHAR.cfg. Content given below. \" abcd1234 \| abcd1235 \$ abcd1236 So it has two record per line delimited by space. No I am looking for some help on how to replace this special charaters ( mentioned in record 1 of each line) with the values mentioned in... (7 Replies)
Discussion started by: Anupam_Halder
7 Replies

9. Shell Programming and Scripting

Search pattern in a file taking input from another file

Hi, Below is my requirement File1: svasjsdhvassdvasdhhgvasddhvasdhasdjhvasdjsahvasdjvdasjdvvsadjhv vdjvsdjasvdasdjbasdjbasdjhasbdasjhdbjheasbdasjdsajhbjasbjasbhddjb svfsdhgvfdshgvfsdhfvsdadhfvsajhvasjdhvsajhdvsadjvhasjhdvjhsadjahs File2: sdh hgv I need a command such that... (8 Replies)
Discussion started by: imrandec85
8 Replies

10. Shell Programming and Scripting

Taking key values from one file and extracting values from another file

Hi, I have two files with values in both. File1: cat 2 3 dog 4 5 elephant 6 7 camel 2 3 File2: ----+--gkf;ajf= ---+---- +----- cat -------=----+ 3 | 4 ----- dog ------++-- 5 | 9 ----++-- elephant | 5 | 7 ---++ camel ------ ++++_---- || 8 | 9 I want the final file as: cat 4... (1 Reply)
Discussion started by: npatwardhan
1 Replies
MAKESH(1)						      General Commands Manual							 MAKESH(1)

NAME
makeSH - a .SH script maker SYNOPSIS
makeSH files DESCRIPTION
MakeSH examines one or more scripts and produces a .SH file that, when run under sh, will produce the original script. The .SH script so produced has two sections containing code destined for the output. The first section has variable substitutions performed on it (taking values from config.sh), while the second section does not. MakeSH does not know which variables you want to have substituted, so it puts the whole script into the second section. It's up to you to insert any variable substitutions in the first section for any values you want from config.sh. You should run makeSH from within your top-level directory and use the relative path to the file as an argument, so that the "Extracting ..." line printed while running the produced .SH file later on will give that same path. AUTHOR
Larry Wall <lwall@netlabs.com> SEE ALSO
pat(1), metaconfig(1), makedist(1). BUGS
It could assume that variables from metaconfig's Glossary need to be initialized in the first section, but I'm too lazy to make it do that. LOCAL MAKESH(1)
All times are GMT -4. The time now is 10:31 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy