07-12-2005
shellscript for finding and replacing in DG-UNIX
Newby here.....
Is there any way of doing a find & replace within a huge file other than using something like : " vi - FileForReplacing < /u1/excel/consultants "
contents of consultants file looks like
:1,$s/0000031/CON/g
:1,$s/0001032/JONES/g
:1,$s/0001355/SMITH/g
:1,$s/0002095/ARMSTRONG/g....etc! etc! etc!
the consultants file is quite large and this make the script run for sometime before it finishes
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Hi,
I have several files with data that have to be imported to a database. These files contain records with separator characters. Some records are corrupt (2 separators are missing) and I need to correct them prior to importing them into the db.
Example:
... (5 Replies)
Discussion started by: stresing
5 Replies
2. Shell Programming and Scripting
Hi everyone.
Could u be so kind and help me with on "simple" shell script?
1. i need to search a file line by line for a pattern.
example of a lines in that file
2947 domain = feD,id = 00 0A 02 48 17 1E 1D 39 DE 00 0E 00,Name
Values:snNo = f10
Add AttFlag = 0
2. i need to find... (0 Replies)
Discussion started by: dusoo
0 Replies
3. Shell Programming and Scripting
Hi all
i need some help in writing a small script that searches a string and then replaces it by a new string
for searching the best result i get is from find comand combined with xargs
e.g.
find . -name "*.*" |xargs grep -l "search string"
this command I use in root directory and this... (4 Replies)
Discussion started by: Aditya_IT
4 Replies
4. Shell Programming and Scripting
Hi All,
I am trying to write a shell script which firstly will search some files and then increase the port numbers mentioned in them by a certain no.
let me clear it with an example-
suppose there r few files a,b,c,d....
file a's content-
<serverEntries xmi:id="ServerEntry_1"... (3 Replies)
Discussion started by: ankushsingh10
3 Replies
5. UNIX for Dummies Questions & Answers
All
I have a very large file (aproximately 150,000) as shown below separated by pipe "|". I need to replace data in 2, 16, 17, 23 fields that are of time stamp format. My goal is to look in those fields and it ends with "000000|" then replace it with "000|". In other words, make it as 6 digit... (2 Replies)
Discussion started by: ddraj2015
2 Replies
6. Shell Programming and Scripting
Hi,
I would like to do a scripting for finding the links based on the name I have and replace the links with the new name. General find command lists everything for that links ( means all the sub-sirs and all the files), i need only the main link and replace.
Can you anyone give me some... (1 Reply)
Discussion started by: rrb2009
1 Replies
7. Shell Programming and Scripting
Hi Friends,
I have a text file which has about 200,000 records in it. we have a string which repeats in each and every record. So we have to write a script in ksh which finds that string on each line and replaces it with a new string(incremental value) for a set every four records.
To be... (12 Replies)
Discussion started by: vpv0002
12 Replies
8. Homework & Coursework Questions
Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted!
1. The problem statement, all variables and given/known data:
What command would rename "sequentialInsert", in
~cs252/Assignments/commandsAsst/project/arrayops.h, to... (2 Replies)
Discussion started by: lothwen
2 Replies
9. Shell Programming and Scripting
Hi all,
assume that i am having the following line in a file called file1.
triumph and disaster must be treated same.
I want to replace this line with.
follow excellence success will chase you.
is it possible to do this using sed. if possible kindly post me the... (2 Replies)
Discussion started by: anishkumarv
2 Replies
10. Shell Programming and Scripting
Hi,
I need help in the following:
I have a file in directory with mutiple comma seperated values. One of the value is a date and time format like 2012-04-10 xx:yy:zz
I need to find that time format in the file and then replace it with xx:yy+1:zz
and then save it as a new file and copy it to a... (3 Replies)
Discussion started by: rabh
3 Replies
LEARN ABOUT DEBIAN
vend::payment::psigate
Vend::Payment::PSiGate(3pm) User Contributed Perl Documentation Vend::Payment::PSiGate(3pm)
NAME
Vend::Payment::PSiGate - Interchange PSiGate Support
SYNOPSIS
&charge=psigate
or
[charge mode=psigate param1=value1 param2=value2]
PREREQUISITES
Net::SSLeay
or
LWP::UserAgent and Crypt::SSLeay
Only one of these need be present and working.
DESCRIPTION
The Vend::Payment::PSiGate module implements the psigate() routine for use with Interchange. It is compatible on a call level with the
other Interchange payment modules.
To enable this module, place this directive in "interchange.cfg":
Require module Vend::Payment::PSiGate
This must be in interchange.cfg or a file included from it.
Make sure CreditCardAuto is off (default in Interchange demos).
The mode can be named anything, but the "gateway" parameter must be set to "psigate". To make it the default payment gateway for all credit
card transactions in a specific catalog, you can set in "catalog.cfg":
Variable MV_PAYMENT_MODE psigate
It uses several of the standard settings from Interchange payment. Any time we speak of a setting, it is obtained either first from the
tag/call options, then from an Interchange order Route named for the mode, then finally a default global payment variable, For example, the
"id" parameter would be specified by:
[charge mode=psigate id=YourPSiGateMerchantID]
or
Route psigate id YourPSiGateMerchantID
or
Variable MV_PAYMENT_ID YourPSiGateMerchantID
The active settings are:
id Your PSiGate.com account ID, supplied by PSiGate.com when you sign up. Global parameter is MV_PAYMENT_ID.
referer
A valid referering url (match this with your setting on PSiGate). Global parameter is MV_PAYMENT_REFERER.
transaction
The type of transaction to be run. Valid values are:
Interchange PSiGate Note
---------------- ----------------- ---------
auth '1', PreAuth
sale '0', Sale
settle '2', PostAuth
void '9', Void
remap
This remaps the form variable names to the ones needed by PSiGate. See the "Payment Settings" heading in the Interchange documentation
for use.
test
Set this to "TRUE" if you wish to operate in test mode, i.e. set the PSiGate "x_Test_Request" query paramter to TRUE.i
Examples:
Route psigate test TRUE
or
Variable MV_PAYMENT_TEST TRUE
or
[charge mode=psigate test=TRUE]
Troubleshooting
Try the instructions above, then enable test mode. A test order should complete.
Disable test mode, then test in various PSiGate error modes by using the credit card number 4111 1111 1111 1111.
Then try a sale with the card number "4111 1111 1111 1111" and a valid expiration date. The sale should be denied, and the reason should be
in [data session payment_error].
If nothing works:
o Make sure you "Require"d the module in interchange.cfg:
Require module Vend::Payment::PSiGate
o Make sure either Net::SSLeay or Crypt::SSLeay and LWP::UserAgent are installed and working. You can test to see whether your Perl
thinks they are:
perl -MNet::SSLeay -e 'print "It works
"'
or
perl -MLWP::UserAgent -MCrypt::SSLeay -e 'print "It works
"'
If either one prints "It works." and returns to the prompt you should be OK (presuming they are in working order otherwise).
o Check the error logs, both catalog and global.
o Make sure you set your payment parameters properly.
o Try an order, then put this code in a page:
<XMP>
[calc]
my $string = $Tag->uneval( { ref => $Session->{payment_result} });
$string =~ s/{/{
/;
$string =~ s/,/,
/g;
return $string;
[/calc]
</XMP>
That should show what happened.
o If all else fails, Red Hat and other consultants are available to help with integration for a fee.
BUGS
There is actually nothing *in* Vend::Payment::PSiGate. It changes packages to Vend::Payment and places things there.
AUTHORS
Mark Stosberg <mark@summersault.com>, based on original code by Mike Heins <mheins@redhat.com>.
CREDITS
Jeff Nappi <brage@cyberhighway.net>
Paul Delys <paul@gi.alaska.edu>
webmaster@nameastar.net
Ray Desjardins <ray@dfwmicrotech.com>
Nelson H. Ferrari <nferrari@ccsc.com>
perl v5.14.2 2011-03-09 Vend::Payment::PSiGate(3pm)