hi all ,
i want a command that interacts with the input of a user .
i.e.
i want it to serch a file for the first occurance of a variable and replace the value that is after the equal sign .
for example :
my file contains a varible that is $HOME=/home
i want to search for variable $HOME... (4 Replies)
I have an xml file with following tags
<NewTag>value123</xyz>
<NewTag>value321</abcd>
I have to replace the values in between the tags with some value ( VAL1/VAL2)
but the thing the ending tag can be any thing, for this i need a awk command
currently i am using this but it... (5 Replies)
Hi all,
I need help in replacing awk with sed for the below.
1 ) cat list | awk -F" |," '/MATH/ {sub(/]*/,"",$3); print $3}'
Eg: file : list
Sno Subno Name
1 SUB1 ENG
2 SUB2 MATH
2)
Eg:result
Total No of Students: 2
Sno ID Sub
------------------
1 ... (3 Replies)
hi
i am using awk for first time so i am having issue
is it the correct way of using
Y here is variable which i fetch using grep from file
awk -v X={$Y}
{
if ($0 ~ /X/ ) { sub (out.*/,"out1",$0) }
print 0
}, filename > temp
when i look into temp file i dont see any replacement... (9 Replies)
Hello everyone,
I have a problem with awk replacement... I need to replace "|\n" for "\n"
I tried thisawk '{ sub(/\|\\n/, "\\n"); print }'
but it seems like it doesn't work properly. Can anyone help with that? (4 Replies)
I been trying to figure out how to use element of array as a replacement pattern. This works as I expected:
$ echo "one two three" | awk '{
gsub(/wo/,"_BEG_&_END_",$2);
print }'
one t_BEG_wo_END_ three
$ echo "one two three" | awk '{
tmp="foo";
gsub(/wo/,"_BEG_" tmp "_END_",$2);... (5 Replies)
Hi,
I have a file where I want to replace the 15th field separated by comma, only on specific lines matching lots of different conditions.
I have managed to read the file line by line, within the loop my line is held in a variable called $line
I assume this will be using sed (maybe... (5 Replies)
Hi All,
I am trying to replace the variable in the file after the particular match string. It is being replaced if i hardcode the value and with use of "&" with sed.
sed -e "s/URL./& http:\\localhost:7223/g"
But when am trying to pass the variable it is failing. I tried multiple... (9 Replies)
Hi,,
I have the line below in a file:
$!VarSet |LFDSFN1| = '"E:\APC\Trials\20140705_427_Prototype Trial\Data\T4_20140705_Trial_Cycle_Data_13_T_Norm.txt" "VERSION=100 FILEEXT=\"*.txt\" FILEDESC=\"General Text\" "+""+"TITLE{SEARCH=NONE NAME=\"New Dataset\" LINE=1I want to write a script to change... (2 Replies)
Dear all,
I have a "SQL request" in a file: that request include different "host variable" and I would like to substitute the different "host variable" by their respective content before executing the request.
For example:
$ echo $SHELL
/bin/bash
$ cat dae2.txt
DELETE FROM ... (11 Replies)
Discussion started by: dae
11 Replies
LEARN ABOUT PHP
cubrid_field_len
CUBRID_FIELD_LEN(3) 1 CUBRID_FIELD_LEN(3)cubrid_field_len - Get the maximum length of the specified fieldSYNOPSIS
int cubrid_field_len (resource $result, int $field_offset)
DESCRIPTION
This function returns the maximum length of the specified field on success, or it returns FALSE on failure.
PARAMETERS
o $result
-$result comes from a call to cubrid_execute(3)
o $field_offset
-The numerical field offset. The $field_offset starts at 0. If $field_offset does not exist, an error of level E_WARNING is also
issued.
RETURN VALUES
Maximum length, when process is successful.
FALSE on failure.
EXAMPLES
Example #1
cubrid_field_len(3) example
<?php
$conn = cubrid_connect("localhost", 33000, "demodb");
$result = cubrid_execute($conn, "SELECT * FROM game WHERE host_year=2004 AND nation_code='AUS' AND medal='G'");
$column_names = cubrid_column_names($result);
$column_types = cubrid_column_types($result);
printf("%-30s %-30s %-15s
", "Column Names", "Column Types", "Column Maxlen");
for($i = 0, $size = count($column_names); $i < $size; $i++) {
$column_len = cubrid_field_len($result, $i);
printf("%-30s %-30s %-15s
", $column_names[$i], $column_types[$i], $column_len);
}
cubrid_disconnect($conn);
?>
The above example will output:
Column Names Column Types Column Maxlen
host_year integer 11
event_code integer 11
athlete_code integer 11
stadium_code integer 11
nation_code char 3
medal char 1
game_date date 10
PHP Documentation Group CUBRID_FIELD_LEN(3)