10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hello Guys,
I am pretty new to unix shell scripting where in i need to compare two files which are comma separated files.
So here i go with the file contents
cty_id,grade_val,g_val_2,g_val_3
001,10,20,30
002,,,40
003,100,,10
grade_val,g_val_2,cty_id
10,20,001
41,,002
100,1,003... (4 Replies)
Discussion started by: Master_Mind
4 Replies
2. Shell Programming and Scripting
In the tab-delimited files, I am trying to match
$1,$2,$3,$4,$5 in fiel1 with $1,$2,$3,$4,$5 in fiel2 and create and output file that lists what matches and what was not found (or doesn't match).
However the awk below seems to skip the first line and does not produce the desired output. I think... (2 Replies)
Discussion started by: cmccabe
2 Replies
3. Shell Programming and Scripting
I am trying to output the matches between $1 of file1 to $3 of file2 into a new file match.
I am also wanting to output the mismatches between those same 2 files and fields to two separate new files called missing from file1 and missing from file2. The input files are tab-delimited, but the... (9 Replies)
Discussion started by: cmccabe
9 Replies
4. Shell Programming and Scripting
Hi,
I am trying with the below Perl command to print the first field when the second field matches the given pattern:
perl -lane 'open F, "< myfile"; for $i (<F>) {chomp $i; if ($F =~ /patt$/) {my $f = (split(" ", $i)); print "$f";}} close F' dummy_file
I know I can achieve the same with the... (7 Replies)
Discussion started by: royalibrahim
7 Replies
5. Shell Programming and Scripting
Hi,
A perl newbie here so pretty sure it's something simple. Trying to figure out how to count matches with perl pattern matching. The following script opens a text data file and finds lines containing
"PORT:" and I'd like to count how many of these are found.
Any ideas?
open(LOG,"<... (3 Replies)
Discussion started by: hdefjunkie
3 Replies
6. UNIX for Advanced & Expert Users
Hi
I am spooling the table values in file in unix ,but the problem is date format in table 'dd/mm/yyyy' ,when strong into file 'dd-mon-yyyy'.I want the same format to loaded into files also.Any idea.
$ORACLE_HOME/bin/sqlplus -S "$db"<<! | tee -a >$INFA_HOME/server/infa_shared/CTRL.log
... (1 Reply)
Discussion started by: akil
1 Replies
7. Shell Programming and Scripting
Can we please modify this perl one-liner to print lines between pattern1 and pattern2 in a file?
Currently it prints lines till pattern2. (4 Replies)
Discussion started by: anand_bh
4 Replies
8. Shell Programming and Scripting
#!/usr/bin/perl
use Shell;
open THEFILE, "C:\galileo_integration.txt" || die "Couldnt open the file!";
@wholeThing = <THEFILE>;
close THEFILE;
foreach $line (@wholeThing){
if ($line =~ m/\\0$/){
@nextThing = $line;
if ($line =~ s/\\0/\\LATEST/g){
@otherThing =... (2 Replies)
Discussion started by: nmattam
2 Replies
9. Shell Programming and Scripting
pls help me on this... and im really sorry because i really don't know where to start here...
FILE1
ABC DEF 10 2
DEF GHI 11 3
GHI JKL 12 5
JKL MNO 13 7
MNO PQR 14 5
requirements:
1. The third string should only be 10 or 12
2. The fourth string should only be 2 or 3
3. Prinnt... (1 Reply)
Discussion started by: kingpeejay
1 Replies
10. Shell Programming and Scripting
Hello all
i have this simple loop that gets me every time the match of "<#" in my string
something like that :
my $str ="gggg<#nnnnn#>kkkk<#ssss#>llllll";
while($str =~m/<#/g){
print pos($str);
}
but now i like to get another pos in the same loop iteration , i will like to get the... (1 Reply)
Discussion started by: umen
1 Replies
WILDMAT(3) Library Functions Manual WILDMAT(3)
NAME
wildmat - perform shell-style wildcard matching
SYNOPSIS
int
wildmat(text, pattern)
char *text;
char *pattern;
DESCRIPTION
Wildmat is part of libinn (3). Wildmat compares the text against the pattern and returns non-zero if the pattern matches the text. The
pattern is interpreted according to rules similar to shell filename wildcards, and not as a full regular expression such as those handled
by the grep(1) family of programs or the regex(3) or regexp(3) set of routines.
The pattern is interpreted as follows:
x Turns off the special meaning of x and matches it directly; this is used mostly before a question mark or asterisk, and is not spe-
cial inside square brackets.
? Matches any single character.
* Matches any sequence of zero or more characters.
[x...y]
Matches any single character specified by the set x...y. A minus sign may be used to indicate a range of characters. That is,
[0-5abc] is a shorthand for [012345abc]. More than one range may appear inside a character set; [0-9a-zA-Z._] matches almost all of
the legal characters for a host name. The close bracket, ], may be used if it is the first character in the set. The minus sign,
-, may be used if it is either the first or last character in the set.
[^x...y]
This matches any character not in the set x...y, which is interpreted as described above. For example, [^]-] matches any character
other than a close bracket or minus sign.
HISTORY
Written by Rich $alz <rsalz@uunet.uu.net> in 1986, and posted to Usenet several times since then, most notably in comp.sources.misc in
March, 1991.
Lars Mathiesen <thorinn@diku.dk> enhanced the multi-asterisk failure mode in early 1991.
Rich and Lars increased the efficiency of star patterns and reposted it to comp.sources.misc in April, 1991.
Robert Elz <kre@munnari.oz.au> added minus sign and close bracket handling in June, 1991.
This is revision 1.10, dated 1992/04/03.
SEE ALSO
grep(1), regex(3), regexp(3).
WILDMAT(3)