Sponsored Content
Top Forums Shell Programming and Scripting How to compare particular string, if it is equal put into a new file Post 302430644 by gagan4599 on Friday 18th of June 2010 07:57:46 AM
Old 06-18-2010
Bug How to compare particular string, if it is equal put into a new file

Hi,
I have a file (sample.txt) this file contains below text.
Code:
./au
./11.5.0
./11.5.0/admin
./11.5.0/admin/driver
./po
./11.5.0
./11.5.0/admin
./11.5.0/admin/driver
./xxsbx/11.5.0/java/src
./xxsbx/11.5.0/lib
./xxsel
./xxsel/11.5.0
./xxsel/11.5.0/admin
./zfa
./zfa/11.5.0
./zfa/11.5.0/admin
./xxplb/11.5.0/workflow
./xxplb/11.5.0/workflow/bes
./[DEST_ENV=ERP11i_QTC_PRD.APP=XXAPPS.SERVER_BASE_PATH]
./[DEST_ENV=ERP11i_QTC_PRD.APP=XXAPPS.SERVER_BASE_PATH]/admin


here my requirement is in each line after 2 charcters (./)
if next 2 characters (means 3,4) is "xx" then i want to print that complete line into another file.
Thanks in Advance.

Regards
Gagan.

Last edited by Franklin52; 06-18-2010 at 09:07 AM.. Reason: Please use code tags!
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to compare file name with a string

Hi, Suppose in some directory (/APPS/TEST) I have a file ABCTEST.csv. I want to write a IF condition in which I want to check if filename contains the string ABC then I will do certain operations . I have a variable having value as /APPS/TEST/ABCTEST.csv How Can I achieve this...please... (14 Replies)
Discussion started by: vishalaksha
14 Replies

2. Shell Programming and Scripting

perl, put one array into many array when field is equal to sth

Hi Everyone, #!/usr/bin/perl use strict; use warnings; my @test=("a;b;qqq;c;d","a;b;ggg;c;d","a;b;qqq;c;d"); would like to split the @test array into two array: @test1=(("a;b;qqq;c;d","a;b;qqq;c;d"); and @test2=("a;b;ggg;c;d"); means search for 3rd filed. Thanks find the... (0 Replies)
Discussion started by: jimmy_y
0 Replies

3. Shell Programming and Scripting

compare columns for equal values and output a summary

Hi all I am trying to scan a file that has 3 columns: red blue 123351 red blue 848655 red blue 126354 red blue 023158 black white 654896 red blue 650884 I want an output that sums the rows that have matching columns 1 and 2 :wall: red blue has 5 entries black white has 1 entry ... (4 Replies)
Discussion started by: reno
4 Replies

4. Shell Programming and Scripting

Use grep sed or awk to extract string from log file and put into CSV

I'd like to copy strings from a log file and put them into a CSV. The strings could be on different line numbers, depending on size of log. Example Log File: File = foo.bat Date = 11/11/11 User = Foo Bar Size = 1024 ... CSV should look like: "foo.bat","11/11/11","Foo Bar","1024" (7 Replies)
Discussion started by: chipperuga
7 Replies

5. Shell Programming and Scripting

Take values from a column and put it in a variable and compare

Hi, I have a table in unix from which i want to read the contents line by line, then filter out the values from 6th column one by one and compare it a fixed value. How to do this? (7 Replies)
Discussion started by: arijitsaha
7 Replies

6. Shell Programming and Scripting

AWK splitting a string of equal parts of 500 chars

Hi , can someone help me how to make an AWK code for splitting a string of equal parts of 500 chars in while loop? Thank you! (4 Replies)
Discussion started by: sanantonio7777
4 Replies

7. Shell Programming and Scripting

Compare two CSV files and put the difference in third file with line no,field no and diff value.

I am having two csv files i need to compare these files and the output file should have the information of the differences at the field level. For Example, File 1: A,B,C,D,E,F 1,2,3,4,5,6 File 2: A,C,B,D,E,F 1,2,4,5,5,6 out put file: (12 Replies)
Discussion started by: karingulanagara
12 Replies

8. Shell Programming and Scripting

Put a string to the beginning of a file without a linefeed

Hello, I need to put the following string to the beginning of a file - but it should not create a newline at the end of the string. So, the file I have is a compressed one - with gzip. And I would like to add an ASCII-String to the beginning of the file. The string has a length of 69... (5 Replies)
Discussion started by: API
5 Replies

9. Shell Programming and Scripting

Bash not equal string comparison

Why does this cause an infinite loop? #!/bin/bash while ]; do echo "$(ipcs | awk '{print $2}')" done echo exit 0 I have verified I eventually get Semaphore so it should break out of the while loop. $ echo $(ipcs | awk '{print $2}') Shared shmid 262145 294914... (6 Replies)
Discussion started by: cokedude
6 Replies

10. UNIX for Beginners Questions & Answers

Compare first column from two csv files with greater than or equal, and less than

I have two csv files of different sizes. The output file needs to have file1 contents on top of file2 contents where file2 col1 is >= to file1 col1, and file2 col1(same value) is < file1 col1 (next value). So basically, some file2 rows will be matched to the same file1 row because it is the closet... (7 Replies)
Discussion started by: aachave1
7 Replies
GLOBUS-GATEKEEPER-(8)					       University of Chicago					     GLOBUS-GATEKEEPER-(8)

NAME
globus-gatekeeper-admin - Manage globus-gatekeeper services SYNOPSIS
globus-gatekeeper-admin [-h] globus-gatekeeper-admin [-l] [-n NAME] globus-gatekeeper-admin [-e SERVICE] [-n NAME] globus-gatekeeper-admin [-E] globus-gatekeeper-admin [-d SERVICE] DESCRIPTION
The globus-gatekeeper-admin program manages service entries which are used by the globus-gatekeeper to execute services. Service entries are located in the /etc/grid-services directory. The globus-gatekeeper-admin can list, enable, or disable specific services, or set a service as the default. The -h command-line option shows a brief usage message. Listing services The -l command-line option to globus-gatekeeper-admin will cause it to list all of the services which are available to be run by the globus-gatekeeper. In the output, the service name will be followed by its status in brackets. Possible status strings are ENABLED, DISABLED, and ALIAS to NAME, where NAME is another service name. If the -n NAME is used, then only information about the service named NAME is printed. Enabling services The -e SERVICE command-line option to globus-gatekeeper-admin will cause it to enable a service so that it may be run by the globus-gatekeeper. If the -n NAME option is used as well, then the service will be enabled with the alias NAME. Enabling a default service The -E command-line option to globus-gatekeeper-admin will cause it to enable a service alias with the name jobmanager. The globus-gatekeeper-admin program will choose the first service it finds as the default. To enable a particular service as the default, use the -e parameter described above with the -n parameter. Disabling services The -d SERVICE command-line option to globus-gatekeeper-admin will cause it to disable a service so that it may not be run by the globus-gatekeeper. All aliases to a disabled service are also disabled. FILES
/etc/grid-services Default location of enabled gatekeeper service descriptions. University of Chicago 12/13/2011 GLOBUS-GATEKEEPER-(8)
All times are GMT -4. The time now is 08:01 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy