01-29-2009
Change a Char Multiple line records
Aploogies i'm a bit new on the forums still, the only problem with that solution is that 65501 is the only constant to search for in that field
below are a few examples that i've pulled out from the file
655014100397402
655016000261245
655016100438548
Ideally
655014100397402 would change to 655014100397403
655016000261245 would change to 655016000261246
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I wanted to Replace if 20th Char is space then Replace by X ..
12345678901234567890
AAAA HEXW PROGRM01 (Ended by 3 Spaces ) Followed by junk(can be spaces als)
BBBB HEXW PROGRM01 A0121225001 (Ended by 3 Spaces)Followed by junk
I have Tired some thing of this sort ...
cat... (4 Replies)
Discussion started by: pbsrinivas
4 Replies
2. UNIX for Dummies Questions & Answers
One way I was told to do was incase strings in quotes.
But I was given this option if I can get it to work.
Will this work for splitting up SPF records?
I am try to make bx.example.com reference spf.eu.***, spfa.eu.***, spfb.eu.***, and spfc.eu.***.
spf.eu.example.com 3600 IN TXT "v=spf1... (0 Replies)
Discussion started by: tmanx
0 Replies
3. Shell Programming and Scripting
Hi
I m having ifconfig -a o/p like
sbanlab1:ksh# ifconfig -a | egrep "flags|inet" | awk -F' ' '{print $1,$2}'
lo0: flags=2001000849<UP,LOOPBACK,RUNNING,MULTICAST,IPv4,VIRTUAL>
inet 127.0.0.1
lo0:1: flags=2001000849<UP,LOOPBACK,RUNNING,MULTICAST,IPv4,VIRTUAL>
inet 127.0.0.1
bge0:... (1 Reply)
Discussion started by: tarunn.dubeyy
1 Replies
4. UNIX for Dummies Questions & Answers
Hi everyone.
I am a newbie to Linux stuff. I have this kind of problem which couldn't solve alone. I have a text file with records separated by empty lines like this:
ID: 20
Name: X
Age: 19
ID: 21
Name: Z
ID: 22
Email: xxx@yahoo.com
Name: Y
Age: 19
I want to grep records that... (4 Replies)
Discussion started by: Atrisa
4 Replies
5. Shell Programming and Scripting
Hi Gurus,
I need to cut single record in the file(asdf) to multile records based on the number of bytes..(44 characters). So every record will have 44 characters. All the records should be in the same file..to each of these lines I need to add the folder(<date>) name.
I have a dir. in which... (20 Replies)
Discussion started by: ram2581
20 Replies
6. Shell Programming and Scripting
file contents looks like this :
#START
line1 of record1
line2 of record1
#END
#START
line1 of record2
line2 of record2
line3 of record2
#END
#START
line1 of record3
#END
my question how should i make it a records between #START and #END .
willl i be able to get the contents of the... (5 Replies)
Discussion started by: sathish92
5 Replies
7. Shell Programming and Scripting
Hi All,
I am trying to split a record into multiple records based on a value.
Input.txt
"A",1,0,10
"B",2,0,10,15,20
"C",3,11,14,16,19,21,23
"D",1,0,5
My desired output is:
"A",1,0,10
"B",2,0,10
"B",2,15,20
"C",3,11,14
"C",3,16,19
"C",3,21,23 (4 Replies)
Discussion started by: kmsekhar
4 Replies
8. Shell Programming and Scripting
Hello,
I have some problem in counting char of word, sum and change. I'm not sure shell script can do this.
Input data:
Sam1 BB BB AA AA BB BB BB
Sam2 BB BB AA AA AB AB AB
Sam3 BB BB BB AA BB BB BB
Sam4 AB AB AB AB AB AB AA
Sam5 BB BB AA AA BB BB -- If I count in column 2, B is 9... (3 Replies)
Discussion started by: awil
3 Replies
9. UNIX for Dummies Questions & Answers
Hi everyone,
I've a requirement to modify an existing line which is common to multiple files. I need to replace that existing line with a new line. I've almost 900 ksh files to edit in the similar fashion in the same directory.
Example:
Existing Line: . $HOME/.eff.env (notice the "." at the... (3 Replies)
Discussion started by: kaleem.adil
3 Replies
10. Shell Programming and Scripting
I did help some at another forum to change one line to multiple lines.
var1="abc001: text goes here yyy003: text goes here uuuu004: text goes here"
Running this awk, gives correct result, but its not very nice. Any idea on how to simplify it?
awk '{for (i=1;i<=NF;i++) printf $i~":"?"\n"$i" ":$i"... (7 Replies)
Discussion started by: Jotne
7 Replies
LEARN ABOUT DEBIAN
gd_put_constant
gd_put_constant(3) GETDATA gd_put_constant(3)
NAME
gd_put_constant -- retrieve a scalar constant from a dirfile database
SYNOPSIS
#include <getdata.h>
int gd_put_constant(DIRFILE *dirfile, const char *field_code, gd_type_t data_type, const void *data_in);
DESCRIPTION
The gd_put_constant() function queries a dirfile(5) database specified by dirfile and sets the CONST scalar field_code , which may not con-
tain a representation suffix, to the value specified in data_in, which should be of the type indicated by data_type.
The dirfile argument must point to a valid DIRFILE object previously created by a call to gd_open(3).
The data_type argument should be one of the following symbols, which indicates the desired return type of the data:
GD_UINT8 unsigned 8-bit integer
GD_INT8 signed (two's complement) 8-bit integer
GD_UINT16 unsigned 16-bit integer
GD_INT16 signed (two's complement) 16-bit integer
GD_UINT32 unsigned 32-bit integer
GD_INT32 signed (two's complement) 32-bit integer
GD_UINT64 unsigned 64-bit integer
GD_INT64 signed (two's complement) 64-bit integer
GD_FLOAT32 or GD_FLOAT
IEEE-754 standard 32-bit single precision floating point number
GD_FLOAT64 or GD_DOUBLE
IEEE-754 standard 64-bit double precision floating point number
The data type of the supplied value need not be the same as the type of the storage type of the constant in the database. Type conversion
will be performed as necessary to return the requested type. The argument data_out must point to valid data type of the specified type.
Because constant values are stored in the dirfile metadata, the new value of field_code won't be written to disk until the dirfile metadata
is flushed with gd_metaflush(3), or until the dirfile is closed.
RETURN VALUE
On success, gd_put_constant() returns zero. On error, it returns -1 and sets the dirfile error to a non-zero value. Possible error values
are:
GD_E_ACCMODE
The specified dirfile was opened read-only.
GD_E_BAD_CODE
The field specified by field_code was not found in the database.
GD_E_BAD_DIRFILE
An invalid dirfile was supplied.
GD_E_BAD_FIELD_TYPE
The supplied field_code referred to a field of type other than CONST. The caller should use gd_putdata(3), gd_put_carray(3), or
gd_put_string(3) instead.
GD_E_BAD_REPR
The representation suffix specified in field_code was not recognised.
GD_E_BAD_TYPE
An invalid data_type was specified.
GD_E_INTERNAL_ERROR
An internal error occurred in the library while trying to perform the task. This indicates a bug in the library. Please report
the incident to the maintainer.
GD_E_PROTECTED
The fragment containing the constant was protected from change.
The dirfile error may be retrieved by calling gd_error(3). A descriptive error string for the last error encountered may be obtained from
a call to gd_error_string(3).
SEE ALSO
dirfile(5), gd_metaflush(3), gd_get_constant(3), gd_error(3), gd_error_string(3), gd_open(3), gd_put_carray(3), gd_put_string(3), gd_putda-
ta(3)
Version 0.7.0 4 November 2010 gd_put_constant(3)