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