Hi,
I am new to this forum and i would like to get help in this issue.
I have a file 1.txt as shown:
apple
banana
orange
apple
grapes
banana
orange
grapes
orange
....
Now i would like to search for pattern say apple or orange and then put a # at the beginning of the pattern... (2 Replies)
Hi,
I think you ppl did not get my question correctly, let me explain
I have 1.txt with following entries as shown:
0152364|134444|10.20.30.40|015236433
0233654|122555|10.20.30.50|023365433
**
**
**
In file 2.txt I have the following entries as shown:
... (1 Reply)
Hi All,
I have almost 1000+ files and I want to search specific pattern. Looking forwarded your input.
Search for: word1.word2 (Which procedure contain this word, I need procedure name in output.
Expected output:
procedure test1
procedure test2
procedure test3
procedure test4
... (7 Replies)
Hi all,
I am trying to extract the values ( text between the xml tags) based on the Order Number.
here is the sample input
<?xml version="1.0" encoding="UTF-8"?>
<NJCustomer>
<Header>
<MessageIdentifier>Y504173382</MessageIdentifier>
... (13 Replies)
Using either vim or awk or sed
If I wish to to search for an unknown pattern - lets say 1B2495 or 1Q2345
so Search pattern : 1
and replace the 1 with 2 to print out :
2B2495 or 2Q2345
what are the possible commands.
Struggling here - help would be appreciated. (5 Replies)
Hi All,
Have a file contains multiple line with the following
file.txt
insert: akdkas job:ksdjf
command: aldfasdf asdfsdfa asdfas.sh
machine: asdfa
need to grep for insert and machine and print only "akdkas,asdfa"
cat file.txt | egrep "insert|machine" | awk -F: '{print $2}'
output ... (5 Replies)
Hi,
I am writing a shell script to parse some files, and gather data.
The data in the files is displayed as below.
.......xyz: abz: ......qrt: ....
.......xyz: abz: ......qrt: ...
I have tried using awk and cut, but the position of these values keep changing, so I wasn't able to get... (2 Replies)
Hello Experts , require help . See below output:
File inputs
------------------------------------------
Server Host = mike
id rl images allocated last updated density
vimages expiration last read <------- STATUS ------->... (4 Replies)
Take example of below file.
abc.txt
nas1:/abc/test/test1 /test
nas1:/abc/test/test1/test2 /test/abc
nas1:/abc/test/
Now i have a variable that contains "nas1:/abc/test/test1" value , so i need to search the above file for this variable and print only this line.
... (14 Replies)
Discussion started by: mohit_vardhani
14 Replies
LEARN ABOUT MOJAVE
tcl_stringmatch
Tcl_StringMatch(3) Tcl Library Procedures Tcl_StringMatch(3)__________________________________________________________________________________________________________________________________________________NAME
Tcl_StringMatch, Tcl_StringCaseMatch - test whether a string matches a pattern
SYNOPSIS
#include <tcl.h>
int
Tcl_StringMatch(str, pattern)
int
Tcl_StringCaseMatch(str, pattern, flags)
ARGUMENTS
const char *str (in) String to test.
const char *pattern (in) Pattern to match against string. May contain special characters from the set *?[].
int flags (in) OR-ed combination of match flags, currently only TCL_MATCH_NOCASE. 0 specifies a case-sensitive search.
_________________________________________________________________DESCRIPTION
This utility procedure determines whether a string matches a given pattern. If it does, then Tcl_StringMatch returns 1. Otherwise
Tcl_StringMatch returns 0. The algorithm used for matching is the same algorithm used in the string match Tcl command and is similar to
the algorithm used by the C-shell for file name matching; see the Tcl manual entry for details.
In Tcl_StringCaseMatch, the algorithm is the same, but you have the option to make the matching case-insensitive. If you choose this (by
passing TCL_MATCH_NOCASE), then the string and pattern are essentially matched in the lower case.
KEYWORDS
match, pattern, string
Tcl 8.5 Tcl_StringMatch(3)