Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Matching pattern script (sed or awk?) Post 302447641 by daptal on Monday 23rd of August 2010 11:33:26 PM
Old 08-24-2010
Code:
perl -e '$hash{`head -c 9 $_`} = 1  foreach (`ls file*`);
> ((keys %hash) ==1) ? print  "all three files are same\n" : print "all three files are not same\n";'


HTH,
PL
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Pattern matching sed

MSG="THERE WERE XX RECORDS IN ERROR TABLE,AAAA, WHEN LOADING THE BBBB TABLE WITH EXTRACT FROM CCCC INTO TABLES FOR , DATABASE DDDD." echo "$MSG" > /tmp/mplanmsg.$$.out I wan to replace XX with the content in $recordXX cat /tmp/mplanmsg.$$.out|sed 's/XX/\$recordXX/g'| sed... (3 Replies)
Discussion started by: leemjesse
3 Replies

2. UNIX for Dummies Questions & Answers

Pattern matching New to Sed & Awk

Hello, Despite reading the Pattern Matching chapter in the O'Reilly Sed & Awk book several times and looking at numerous examples, I cannot seem to get any kind of conditional script to work in my awk scripts! I am able to do the basic awk and grep script to capture the data but when I do with... (0 Replies)
Discussion started by: pg55
0 Replies

3. Shell Programming and Scripting

sed pattern matching

Hi, I have a file which contains a word like ravi and ravi30. i want to replace only the word ravi with xxx for that i am using the below sed command sed -e 's/ravi/xxx/g' . but the above command out put is xxx and xxx30 but i dont need to change ravi30 please guide me how to proceed.... (4 Replies)
Discussion started by: ravi_rn
4 Replies

4. Shell Programming and Scripting

sed - matching pattern one but not pattern two

All, I have the following file: -------------------------------------- # # /etc/pam.d/common-password - password-related modules common to all services # # This file is included from other service-specific PAM config files, # and should contain a list of modules that define the services... (2 Replies)
Discussion started by: RobertBerrie
2 Replies

5. Shell Programming and Scripting

Help with sed pattern matching

Hi My log file is Testtmp2 cat Testtmp2 12:12:38 12:14:29 12:17:34 12:19:08 12:20:10 12:21:35 12:22:20 12:22:26 12:22:34 12:22:38 12:28:14 12:31:35 12:32:50 12:33:04 (3 Replies)
Discussion started by: rahkumar
3 Replies

6. Shell Programming and Scripting

awk pattern matching in place of sed

I have written a script to parse data from some files on a Solaris 10 system and send the output to a CSV formatted file. The code snipped i am using to pull the data is as follows.... src_line=$(sed -n "/^search_pattern$/{=;}" $file) for i in $src_line do start_line1=$(( i + 9 )) nawk -v... (4 Replies)
Discussion started by: electricheadx
4 Replies

7. Shell Programming and Scripting

Replacing lines matching a multi-line pattern (sed/perl/awk)

Dear Unix Forums, I am hoping you can help me with a pattern matching problem. What am I trying to do? I want to replace multiple lines of a text file (that match a multi-line pattern) with a single line of text. These patterns can span several lines and do not always have the same number of... (10 Replies)
Discussion started by: thefang
10 Replies

8. Shell Programming and Scripting

Sed: printing lines AFTER pattern matching EXCLUDING the line containing the pattern

'Hi I'm using the following code to extract the lines(and redirect them to a txt file) after the pattern match. But the output is inclusive of the line with pattern match. Which option is to be used to exclude the line containing the pattern? sed -n '/Conn.*User/,$p' > consumers.txt (11 Replies)
Discussion started by: essem
11 Replies

9. Shell Programming and Scripting

Use sed to get first matching pattern

HI, I have a file: listenerport: - 1521 - 10520 - 10521 - 10522 - 10523 instances: listenerport: listenerport: - 1521 - 10540 - 10541 - 10542 - 10543 instances: ... (5 Replies)
Discussion started by: netbanker
5 Replies

10. Shell Programming and Scripting

awk script issue redirecting to multiple files after matching pattern

Hi All I am having one awk and sed requirement for the below problem. I tried multiple options in my sed or awk and right output is not coming out. Problem Description ############################################################### I am having a big file say file having repeated... (4 Replies)
Discussion started by: kshitij
4 Replies
WMA(3pm)						User Contributed Perl Documentation						  WMA(3pm)

NAME
Audio::WMA - Perl extension for reading WMA/ASF Metadata SYNOPSIS
use Audio::WMA; my $wma = Audio::WMA->new($file); my $info = $wma->info(); foreach (keys %$info) { print "$_: $info->{$_} "; } my $tags = $wma->tags(); foreach (keys %$tags) { print "$_: $tags->{$_} "; } DESCRIPTION
This module implements access to metadata contained in WMA files. METHODS
o new( $file ) Create a new Audio::WMA instance from the data in $file o info( ) Get the audio data information in the form of a hash ref. o tags( ) Get the metadata / tag information in the form of a hash ref. o stream( ) Get the current ASF stream. o parseObject( $asf ) Parse a standalone ASF object. o setDebug( 0 | 1 ) Toggle debugging. o setConvertTagsToUTF8( 0 | 1 ) Toggle Encoding metadata tags as UTF-8 Toggle debugging. SEE ALSO
Audio::FLAC::Header, <http://getid3.sf.net/> http://github.com/dsully/perl-audio/tree/master/Audio-WMA AUTHOR
Dan Sully, <daniel | at | cpan.org> COPYRIGHT AND LICENSE
Copyright 2003-2008 by Dan Sully & Logitech. This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. perl v5.10.0 2008-11-29 WMA(3pm)
All times are GMT -4. The time now is 10:13 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy