Sponsored Content
Top Forums Shell Programming and Scripting Replace variable length numeric string Post 302284892 by mk4mzid on Friday 6th of February 2009 12:29:43 PM
Old 02-06-2009
Man, thanks for the quick replies everyone. I haven't played with any of them yet, I will after this post. But I wanted to give you the entire picture, just in case it helps, sorry should have put this in the orig post.

Here is a single entry from the log (edited of course)
Code:
www.testsite.org 11.222.333.444 - - [02/Feb/2009:13:58:18 -0600] "GET /regrenew/pay.cgi?fname=complete_payment&args=John%20C.%20Doe&acctname=John
%20C.%20Doe&args=2468%20Jackson&acctaddress=2468%20Jackson&args=Miami&acctcity=Miami&args=FL&acctstate=FL&args=12345&acctzip=12345&args=111111111
&routing=111111111&args=2222222222&acctnum=2222222222&args=jdoe@email.net&acctemail=jdoe@email.net&args=999-999-9999&acctphone=999-999-9999 HTTP/
1.1" 200 1996 "https://www.testsite.org/regrenew/index.cgi" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322; .NET CLR 
2.0.50727; .NET CLR 3.0.04506.30; .NET CLR 3.0.04506.648; Windows-Media-Player/10.00.00.3990; Zune 3.0)"

I just need to x out this section
Code:
args=111111111&routing=111111111&args=2222222222&acctnum=2222222222

I need to keep all other entries, phone, address, zip, etc.

Again thanks a ton for the quick replies, I'm going to go test them now.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Finding out the length of a string held within a variable

:confused: Does anyone know which command I can use to find out the length of a string held within a variable? (5 Replies)
Discussion started by: dbrundrett
5 Replies

2. Shell Programming and Scripting

numeric string and length

given a string passed to a program that supposed to be numeric and of a certain length say 8 digits - so say for e.g. need to verify this 01234567 How would I parse this string to validat it meet requirements I tried to use * | sed /\(\{8})/ Thanks in advance (1 Reply)
Discussion started by: dragrid
1 Replies

3. Shell Programming and Scripting

awk - replace number of string length from search and replace for a serialized array

Hello, I really would appreciate some help with a bash script for some string manipulation on an SQL dump: I'd like to be able to rename "sites/WHATEVER/files" to "sites/SOMETHINGELSE/files" within the sql dump. This is quite easy with sed: sed -e... (1 Reply)
Discussion started by: otrotipo
1 Replies

4. Shell Programming and Scripting

Replacing one Char in a string of variable length

Hi all, I am trying to find the best way of making a change to 1 char in a string, the string can be between 1 and 14 characters. I am reading a line in from a file which contains 012341231231:2:102939283:NNN: Require :NBN: 012838238232:3:372932:NNN: Require :NNB: I need to change 1 N or a... (8 Replies)
Discussion started by: nkwilliams
8 Replies

5. UNIX for Dummies Questions & Answers

Find and Replace random numeric value with non-numeric value

Can someone tell me how to change the first column in a very large 17k line file from a random 10 digit numeric value to a non numeric value. The format of lines in the file is: 1702938475,SNU022,201004 the first 10 numbers always begin with 170 (6 Replies)
Discussion started by: Bahf1s
6 Replies

6. Shell Programming and Scripting

String variable to numeric conversion in perl

Hi guys I am having this strange issue.Well my requirement is like below Compare two values between flat file and oracle DB Via perl script I am easily getting the rowcount Now I connect sql plus via perl and the column value that returns is string my $sqlplus_settings = ''; my... (7 Replies)
Discussion started by: Pratik4891
7 Replies

7. Shell Programming and Scripting

Match and variable length string

Hello all, source file looks like this: cat toto.txt NAME) VAR1=tata OPT4=toto USER=blabla TZ=/usr/share/zoneinfo/Hongkong OTHEROPT=something ;; NAME2) VAR1=tata OPT4=toto USER=blabla TZ=/usr/share/zoneinfo/Hongkong SOMETHING=else ... (5 Replies)
Discussion started by: maverick72
5 Replies

8. Shell Programming and Scripting

Extracting substrings from a string of variable length

I have a string like Months=jan feb mar april x y .. Here the number of fields in Months is not definite I need to extract each field in the Months string and pass it to awk . Don't want to use for in since it is a loop . How can i do it (2 Replies)
Discussion started by: Nevergivup
2 Replies

9. Shell Programming and Scripting

Need to replace 32 length string to *****

Hello, I've a file file_1.txt ul.ln = 'Kb' AND (il.sum = 'ec7ccc92585adac28d9b1fb5eff0473f' or length('ec7ccc92585adac28d9b1fb5eff0473f') = 7); il.sum = '20ddc1368d588dd0b0e37c41721e05b1' OR length('20ddc1368d588dd0b0e37c41721e05b1') = 7); I need to replace the file like below - ul.ln... (4 Replies)
Discussion started by: Mannu2525
4 Replies

10. UNIX for Beginners Questions & Answers

Views How to replace a CRLF char from a variable length file in the middle of a string in UNIX?

My sample file is variable length, with out any field delimiters. It has min of 18 chars length and the 'CRLF' is potentially between 12-14 chars. How do I replace this with a space? I still want to keep end of record, but just want to remove these new lines chars in the middle of the data. ... (7 Replies)
Discussion started by: chandrath
7 Replies
XtSetArg(3Xt)															     XtSetArg(3Xt)

NAME
XtSetArg, XtMergeArgLists - set and merge ArgLists SYNOPSIS
XtSetArg(arg, name, value) Arg arg; String name; XtArgVal value; ArgList XtMergeArgLists(args1, num_args1, args2, num_args2) ArgList args1; Cardinal num_args1; ArgList args2; Cardinal num_args2; ARGUMENTS
Specifies the name-value pair to set. Specifies the first ArgList. Specifies the second ArgList. Specifies the number of arguments in the first argument list. Specifies the number of arguments in the second argument list. Specifies the name of the resource. Specifies the value of the resource if it will fit in an XtArgVal or the address. DESCRIPTION
The XtSetArg function is usually used in a highly stylized manner to minimize the probability of making a mistake; for example: Arg args[20]; int n; n = 0; XtSetArg(args[n], XtNheight, 100); n++; XtSetArg(args[n], XtNwidth, 200); n++; XtSetValues(widget, args, n); Alternatively, an application can statically declare the argument list and use XtNumber: static Args args[] = { {XtNheight, (XtArgVal) 100}, {XtNwidth, (XtArgVal) 200}, }; XtSetValues(Widget, args, XtNumber(args)); Note that you should not use auto-increment or auto-decrement within the first argument to XtSetArg. XtSetArg can be implemented as a macro that dereferences the first argument twice. The XtMergeArgLists function allocates enough storage to hold the combined ArgList structures and copies them into it. Note that it does not check for duplicate entries. When it is no longer needed, free the returned storage by using XtFree. SEE ALSO
XtOffset(3Xt) X Toolkit Intrinsics -- C Language Interface Xlib -- C Language X Interface XtSetArg(3Xt)
All times are GMT -4. The time now is 12:58 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy