Sponsored Content
Full Discussion: pattern matching problem
Top Forums Shell Programming and Scripting pattern matching problem Post 302142480 by radoulov on Friday 26th of October 2007 11:37:49 AM
Old 10-26-2007
Quote:
[...]
With awk it took me 3 hours and no result and with Java 30 mins and result
[...]
Quote:
Originally Posted by drl
[...]
It looked like the perl script from Yogesh Sawant would work -- did you time it?
[...]

I believe those are not execution timings Smilie
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

problem with CASE pattern matching

I am using ksh on a HP Ux. I have a simple script but am having problem with the case statement:- #!/usr/bin/sh Chl=”SM.APPLE_SWIFT_DV” LoConfirm=”” case $chl in ) LoConfirm=”Using channel at Building 1” echo “test conditon1” echo $LoConfirm;; ) LoConfirm=”Using... (2 Replies)
Discussion started by: gummysweets
2 Replies

2. Shell Programming and Scripting

pattern matching problem

FilesToBackup='*.track* *.xml *.vm* *.gz Trace* TRACE* "*core*" *.out fcif_data_* esi_error_* *.rollback *.sed R.* APStatus_* log* *.output* send_mail* downenv* check_env* intaspurge_db_* sqlnet.log *.rpt *.html *.csv "*TSC*"' and i am using it like this- echo Moving files from $(pwd): ... (2 Replies)
Discussion started by: namishtiwari
2 Replies

3. Shell Programming and Scripting

Pattern Matching problem in UNIX

Hello All, I need help I have a problem in searching the pattern in a file let us say the file contains the below lines line 1 USING *'/FILE/FOLDER/RETURN') ................. ................. line 4 USING *'/FILE/FOLDER/6kdat1') line 5 USING... (2 Replies)
Discussion started by: maxmave
2 Replies

4. Shell Programming and Scripting

problem using sed for pattern matching

if abc.sh is 192.168.1.41 then the output that i get is v5c01 my code is sed 's/192.168.1.4/v5c0/g s/192.168.1.41/acc1/g' abc.sh 2>&1 | tee abc.sh i want to find 192.168.1.4 and replace it with v5c0 and find 192.168.1.41 and replace it with acc1 and i want to do it using sed (5 Replies)
Discussion started by: lassimanji
5 Replies

5. Shell Programming and Scripting

Problem extracting just a part of a matching pattern

Hello everyone, this is my first post so please give me a hand. I apologize for my English, I'll try to be clear with my request. I need to write a script (Bash) which finds all the variables defined in the file .h of the folder and then writes the name of the files .c where these variables are... (1 Reply)
Discussion started by: paxilpaz
1 Replies

6. Shell Programming and Scripting

pattern matching problem

# cat email.txt | grep -i "To:" To: <test@example.com> # cat email.txt | grep -i "Subject" Subject: Test Subject: How are you. I need to print only test@example.com from To field need to eliminate "< & >" from To field and need to print entire subject after Subject: It should be #... (7 Replies)
Discussion started by: mirfan
7 Replies

7. Programming

pl sql . pattern matching problem

hi everyone i am facing a strange problem declare v_var number(10); begin if( regexp_like('RCDORMS_MMS_*_DAR','RCDORMS_MMS_*_DAR')) then v_var:=20; dbms_output.put_line(v_var); end if; end; / please tell me what's the wrong thing in this expression.. as i am not able to get... (1 Reply)
Discussion started by: aishsimplesweet
1 Replies

8. Shell Programming and Scripting

Pattern matching and format problem

Hi I need a bash script that can search through a text file and when it finds 'FSS1206' I need to put a Letter F 100 spaces after the second instance of FSS1206 The format is the same throughout the file I need to repeat this on every time it finds the second 'FSS1206' in the file I have... (3 Replies)
Discussion started by: firefox2k2
3 Replies

9. Shell Programming and Scripting

Pattern matching problem

Hi I need a bash script that can search through a text file for all lines starting with 71502FSC1206 on every line it finds starting with this I need to place a letter F at the 127 position on that line. Thanks Paul (6 Replies)
Discussion started by: firefox2k2
6 Replies

10. Shell Programming and Scripting

Pattern matching problem

if i have to do pattern match for file name with digit alphanumeric value like this File_1234.csv File_12sd45rg.csv i am using this File_*.csv and File_*.csv for digit pattern match. when i am doing pattern match for the digit then both alphanumeric match and digit match is coming. ... (3 Replies)
Discussion started by: ramsavi
3 Replies
PTARGREP(1)						 Perl Programmers Reference Guide					       PTARGREP(1)

NAME
ptargrep - Apply pattern matching to the contents of files in a tar archive SYNOPSIS
ptargrep [options] <pattern> <tar file> ... Options: --basename|-b ignore directory paths from archive --ignore-case|-i do case-insensitive pattern matching --list-only|-l list matching filenames rather than extracting matches --verbose|-v write debugging message to STDERR --help|-? detailed help message DESCRIPTION
This utility allows you to apply pattern matching to the contents of files contained in a tar archive. You might use this to identify all files in an archive which contain lines matching the specified pattern and either print out the pathnames or extract the files. The pattern will be used as a Perl regular expression (as opposed to a simple grep regex). Multiple tar archive filenames can be specified - they will each be processed in turn. OPTIONS
--basename (alias -b) When matching files are extracted, ignore the directory path from the archive and write to the current directory using the basename of the file from the archive. Beware: if two matching files in the archive have the same basename, the second file extracted will overwrite the first. --ignore-case (alias -i) Make pattern matching case-insensitive. --list-only (alias -l) Print the pathname of each matching file from the archive to STDOUT. Without this option, the default behaviour is to extract each matching file. --verbose (alias -v) Log debugging info to STDERR. --help (alias -?) Display this documentation. COPYRIGHT
Copyright 2010 Grant McLean <grantm@cpan.org> This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. perl v5.18.2 2018-08-17 PTARGREP(1)
All times are GMT -4. The time now is 04:30 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy