11-26-2008
The example I posted is not perl, its can be run is shell.
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I have two files - file1 and file2. Now I want records in file2 those are not exist in file1. How to grep this ?
eg:
file1
08941
08944
08945
08946
08947
file2
08942 08944 5
08942 08945 5
08942 08946 4
08942 08947 6
08942 08952 4
08942 08963 5
08942 ... (3 Replies)
Discussion started by: suresh3566
3 Replies
2. Shell Programming and Scripting
Print only records from file 2 that do not match file 1 based on criteria of comparing column 1 and column 6
Was trying to play around with following code I found on other threads but not too successful
Code:
awk 'NR==FNR{p=$1;$1=x;A=$0;next}{$2=$2(A?A:",,,")}1' FS=~ OFS=~ file1 FS="*"... (11 Replies)
Discussion started by: sigh2010
11 Replies
3. UNIX for Dummies Questions & Answers
I have very limited coding skills but I'm wondering if someone could help me with this. There are many threads about matching strings in two files, but I have no idea how to add a column from one file to another based on a matching string.
I'm looking to match column1 in file1 to the number... (3 Replies)
Discussion started by: pathunkathunk
3 Replies
4. Shell Programming and Scripting
Hi Freinds ,
I have 2 files .
File 1
|nag|HYd|1|Che
|esw|Gun|2|hyd
|pra|bhe|3|hyd
|omu|hei|4|bnsj
|uer|oeri|5|uery
File 2
|nag|HYd|1|Che
|esw|Gun|2|hyd
|uer|oi|3|uery
output : (9 Replies)
Discussion started by: i150371485
9 Replies
5. Shell Programming and Scripting
Hi Freinds,
i have a file1 as below
file1
1|ndmf|fdd|d3484|34874
2|jdehf|wru7|478|w489
3|dfkj|wej|484|49894
file2 contains lakhs of records and not in sorted order
i want to retrive only the records from file2 by searcing the first field of file 1
i used
grep ^1 file2... (4 Replies)
Discussion started by: i150371485
4 Replies
6. Shell Programming and Scripting
I have a file containing texts and indexes. I need the text between (and including ) INDEX and number "1" alone in line. I have managed this:
awk '/INDEX/,/1$/{if (!/1$/)print}' file1.txt
It works for all indexes.
And then I have second file with years and indexes per year, one per line... (3 Replies)
Discussion started by: phoebus
3 Replies
7. Shell Programming and Scripting
hi.. i am using solaris system and ksh and using nawk to get records of file1 not in file2(not line by line comparison). code i am using is nawk 'NR==FNR{a++} !a {print"line:" FNR"->" $0} ' file2 file1
same command with awk runs perfectly on darwin kernel(mac) but in solaris it does line by... (2 Replies)
Discussion started by: Abhiraj Singh
2 Replies
8. Shell Programming and Scripting
I have a list of IDs in file1 and a list of sequences in file2. I can print sequences from file2, but I'm asking for help in printing the sequences in the same order as the IDs appear in file1.
file1:
EN_comp12952_c0_seq3:367-1668
ES_comp17168_c1_seq6:1-864
EN_comp13395_c3_seq14:231-1088... (5 Replies)
Discussion started by: pathunkathunk
5 Replies
9. Shell Programming and Scripting
I need to know if file1 is a subset of file2 i.e all the contents of file1 are present in file2 or not.
Here is how i would do it.
Read line by line file1 and grep every line in file2 in a for loop. any failing grep would means that it is not a subset.
Is there a quicker or easier way... (3 Replies)
Discussion started by: mohtashims
3 Replies
10. Shell Programming and Scripting
In-order to check and print if file2 is a subset of file one i do the below.
var1=$(cat //tmp/file1 | sort -u | wc)
var2=$(cat /tmp/file2 /tmp/file1 | sort -u | wc)
if ; then
echo "file2 is a subset of file1 becoz var1 and var2 have the same values."
fi
However, i get the following error ... (1 Reply)
Discussion started by: mohtashims
1 Replies
LEARN ABOUT DEBIAN
xmlrpcsh
XMLRPCSH(1p) User Contributed Perl Documentation XMLRPCSH(1p)
NAME
XMLRPCsh - Interactive shell for XMLRPC calls
SYNOPSIS
perl XMLRPCsh http://betty.userland.com/RPC2
> examples.getStateName(2)
> examples.getStateNames(1,2,3,7)
> examples.getStateList([1,9])
> examples.getStateStruct({a=>1, b=>24})
> Ctrl-D (Ctrl-Z on Windows)
or
# all parameters after uri will be executed as methods
perl XMLRPCsh http://betty.userland.com/RPC2 examples.getStateName(2)
> Ctrl-D (Ctrl-Z on Windows)
DESCRIPTION
XMLRPCsh is a shell for making XMLRPC calls. It takes one parameter, endpoint (actually it will tell you about it if you try to run it).
Additional commands can follow.
After that you'll be able to run any methods of XMLRPC::Lite, like autotype, readable, etc. You can run it the same way as you do it in
your Perl script. You'll see output from method, result of XMLRPC call, detailed info on XMLRPC faulure or transport error.
For full list of available methods see documentation for XMLRPC::Lite.
Along with methods of XMLRPC::Lite you'll be able (and that's much more interesting) run any XMLRPC methods you know about on remote server
and see processed results. You can even switch on debugging (with call something like: "on_debug(sub{print@_})") and see XMLRPC code with
headers sent and received.
COPYRIGHT
Copyright (C) 2000 Paul Kulchenko. All rights reserved.
AUTHOR
Paul Kulchenko (paulclinger@yahoo.com)
perl v5.12.4 2010-06-03 XMLRPCSH(1p)