Add character to specific columns using sed or awk and make it a permanent change
Hi,
I am writing a shell script where I want that # should be added in all those lines as the first character where the pattern matches.
file has lot of functions defined
a.sh
so when i execute the command on a.sh, the file should only be modified for places that has beautiful word
so the new file should be
a.sh
command i could create was
but it doesnt modify in the file. It only gives op on comd prompt. I dont want to create a new file. I want it modified in original file
Last edited by Don Cragun; 10-20-2015 at 10:03 AM..
Reason: Add CODE tags.
Hi,
I have a data file with following structure:
a|b|c|d|3|f1|f2|f3
a|b|c|d|5|f1|f2|f3|f4|f5
I want to change this data to:
a|b|c|d|3|f1;f2;f3
a|b|c|d|5|f1;f2;f3;f4;f5
Data in column 5 tells the number of following fields. All fields delimiter after the 5th column needs to be... (6 Replies)
I am trying to use sed to replace specific characters at a specific position in the file with a different value... can this be done?
Example:
File:
A0199999123
A0199999124
A0199999125
Need to replace 99999 in positions 3-7 with 88888.
Any help is appreciated. (5 Replies)
Hi,
I have file as below:
5 6 7
4 8 9
3 5 6
output needs to be another file with 4th column as $1+$2 and 5th column as $3+$4.
sample output file
5 6 7 11 18
4 8 9 12 21
3 5 6 8 14
Anybody have answer
Thanks in advance (3 Replies)
Greetings.
I don't have experience programing scripts. I need to insert a string in a specific position of another string on another file (last.cfg), for example:
File last.cfg before using script:
login_interval=1800
lcs.machinename=client04
File last.cfg after using script:... (4 Replies)
Hello experts,
I am new to this group and to 'SED' and 'AWK'. I have data (text file) with 5 columns (C_1-5) and 100s of lines (only 10 lines are shown below as an example). I have to find or select only the id numbers (C-1) of specific lines with '90' in the same line (of C_3) AND with '20' in... (6 Replies)
Hi all!
I need to change the final e every time when it is present in any word in column 1 to a; moreover, to change the final i again to a in any word in column 1, but just if word in column 2 begins with ha or si.
Here below you can see a sample of my data:
achwa ungeliachwa ungeli 1... (3 Replies)
Hi,
I made following configuration to create user directory:
# authconfig --enablemkhomedir --update
But the directory is created as permission 755, I'd like to modify the script to change directory access permission to 700, where is the script which copies /etc/skel to /home... (0 Replies)
Hello,
i need help with awk.
I have this file:
cat number
DirB port 67 er_enc_out 0 er_bad_os 0
DirB port 71 er_enc_out 56 er_bad_os 0
DirB port 74 er_enc_out 0 er_bad_os 0
DirB port 75 ... (4 Replies)
What is the proper syntax to add specific text to a column in a file? Both the input and output below are tab-delineated. What if there are multiple text/fields, such as /CP&/2 /CM&/3 /AA&/4 Thank you :).
sed 's/*/Index&/1' del.txt.hg19_multianno.txt > matrix.del.txt (4 Replies)
Discussion started by: cmccabe
4 Replies
LEARN ABOUT PHP
cubrid_lob2_seek
CUBRID_LOB2_SEEK(3) 1 CUBRID_LOB2_SEEK(3)cubrid_lob2_seek - Move the cursor of a lob object.SYNOPSIS
bool cubrid_lob2_seek (resource $lob_identifier, int $offset, [int $origin = CUBRID_CURSOR_CURRENT])
DESCRIPTION
The cubrid_lob2_seek(3) function is used to move the cursor position of a lob object by the value set in the $offset argument, to the
direction set in the $origin argument.
To set the $origin argument, you can use CUBRID_CURSOR_FIRST to set the cursor position moving forward $offset units from the first begin-
ning. In this case, $offset must be a positive value.
If you use CUBRID_CURSOR_CURRENT for $origin, you can move forward or backward. and $offset can be positive or negative.
If you use CUBRID_CURSOR_LAST for $origin, you can move backward $offset units from the end of LOB object and $offset only can be posi-
tive.
PARAMETERS
o $lob_identifier
-Lob identifier as a result of cubrid_lob2_new(3) or get from the result set.
o $offset
-Number of units you want to move the cursor.
o $origin
-This parameter can be the following values:CUBRID_CURSOR_FIRST: move forward from the first beginning.CUBRID_CURSOR_CURRENT: move
forward or backward from the current position.CUBRID_CURSOR_LAST: move backward at the end of LOB object.
RETURN VALUES
TRUE if the process is successful and FALSE for failure.
EXAMPLES
Example #1
cubrid_lob2_seek(3) example
<?php
// test_lob (id INT, contents CLOB)
$conn = cubrid_connect("localhost", 33000, "demodb", "dba", "");
cubrid_execute($conn,"DROP TABLE if exists test_lob");
cubrid_execute($conn,"CREATE TABLE test_lob (id INT, contents CLOB)");
$req = cubrid_prepare($conn, "INSERT INTO test_lob VALUES(2, ?)");
$lob = cubrid_lob2_new($conn, 'CLOB');
$len = cubrid_lob2_write($lob, "Hello world");
cubrid_lob2_seek($lob, 0, CUBRID_CURSOR_LAST);
cubrid_lob2_write($lob, "beautiful");
cubrid_lob2_seek($lob, 15, CUBRID_CURSOR_FIRST);
$data = cubrid_lob2_read($lob, 5);
echo $data."
";
cubrid_lob2_bind($req, 1, $lob);
cubrid_execute($req);
cubrid_disconnect($conn);
?>
SEE ALSO cubrid_lob2_read(3), cubrid_lob2_write(3), cubrid_lob2_seek64(3), cubrid_lob2_tell(3), cubrid_lob2_tell64(3), cubrid_lob2_size(3),
cubrid_lob2_size64(3).
PHP Documentation Group CUBRID_LOB2_SEEK(3)