Hi,
I have file with all the lines as following format
I want to replace (all the lines) value of 'name' by value of 'nameInNameSpace' converted to lowercase with '/' substituted by '.'
For example, in this case, this line would become
Greatly appreciate any suggestion.
Many Thanks.
Last edited by jim mcnamara; 12-28-2011 at 02:28 PM..
Reason: please use code tags to format your examples
I need to remove the '&' from a file.
In each line of the file, the fields are separated by ^K.
I only want to remove '&' if it exists in field number 9. (example of field 9: abc&xyz)
I need to do an in place/in line edit.
So far I have accomplished the following:
awk -F '^K' '{print... (6 Replies)
Col1 Col2 Col3 Col4
12 Completed 08 0830
12 In Progress 09 0829
11 For F U 07 0828
Considering the file above, how could i replace the third column the most efficient way? The actual file size is almost 1G. I am... (10 Replies)
I have the follwoing file:
This looks to be : seperated.
For the first field i want only the file name without ".txt" and also i want to remove "+" sign if the second field starts with "+" sign.
Input file:
Output file:
Appreciate your help (9 Replies)
What is an efficient way to remove all lines from the input file which contain a file name?
inputfile:
=======================
# comment
# comment
# comment
5 8 10 /tmp
5 8 10 /var/run
5 8 10 /etc/vfstab
5 8 9 /var/tmp
5 8 10 /var/adm/messages... (7 Replies)
I'm having a couple of issues. I'm trying to edit a nagios config and remove a host definition if a certain "host_name" is found. My thought is I would find host definition block containing the host_name I'm looking for and output the line numbers for the first and last lines. Using set, I will... (9 Replies)
please help me to edit the second field using awk or sed
i have input file below
aa1001 000001
bb1002 000002
cc1003 000003
so i want the output file like below
aa1001 01
bb1002 02
cc1003 03 (38 Replies)
Hi Experts,
I am new to shell scripting. Need some help in doing one task given by the customer.
The sample record in a file is as follows:
3538,,,,,,ID,ID1,,,,,,,,,,,
It needs to be the following:
3538,,353800,353800,,,ID,ID1,,,,,COLX,,,,,COLY,
And i want to modify this record in... (3 Replies)
I've ended up with a small collection of libraries I like to use with awk, but this means I can't do awk -f librarycode.awk '{ program code }' filename because awk will assume that anything after -f is a filename, not code. Is there any way I can do both? (6 Replies)
Hello,
Just surfed on the web for probable answers but could not get them working.
I wish to replace the string containing spaces by another phrase but below answers did not work.
My string is:
PAIN & GAIN
I wish to convert it to:
P&G
I just need it working with sed with function -i
... (6 Replies)
Discussion started by: baris35
6 Replies
LEARN ABOUT PHP
ifx_fetch_row
IFX_FETCH_ROW(3) 1 IFX_FETCH_ROW(3)ifx_fetch_row - Get row as an associative arraySYNOPSIS
array ifx_fetch_row (resource $result_id, [mixed $position])
DESCRIPTION
Fetches one row of data from the result associated with the specified result identifier.
Subsequent calls to ifx_fetch_row(3) would return the next row in the result set, or FALSE if there are no more rows.
PARAMETERS
o $result_id
-$result_id is a valid resultid returned by ifx_query(3) or ifx_prepare(3) (select type queries only!).
o $position
- An optional parameter for a "fetch" operation on "scroll" cursors: NEXT, PREVIOUS, CURRENT, FIRST, LAST or a number. If you
specify a number, an "absolute" row fetch is executed. This parameter is optional, and only valid for SCROLL cursors.
RETURN VALUES
Returns an associative array that corresponds to the fetched row, or FALSE if there are no more rows.
Blob columns are returned as integer blob id values for use in ifx_get_blob(3) unless you have used ifx_textasvarchar(1) or ifx_byteasvar-
char(1), in which case blobs are returned as string values.
EXAMPLES
Example #1
Informix fetch rows
<?php
$rid = ifx_prepare ("select * from emp where name like " . $name,
$connid, IFX_SCROLL);
if (! $rid) {
/* ... error ... */
}
$rowcount = ifx_affected_rows($rid);
if ($rowcount > 1000) {
printf ("Too many rows in result set (%d)
<br />", $rowcount);
die ("Please restrict your query<br />
");
}
if (! ifx_do ($rid)) {
/* ... error ... */
}
$row = ifx_fetch_row ($rid, "NEXT");
while (is_array($row)) {
for (reset($row); $fieldname=key($row); next($row)) {
$fieldvalue = $row[$fieldname];
printf ("%s = %s,", $fieldname, $fieldvalue);
}
printf("
<br />");
$row = ifx_fetch_row($rid, "NEXT");
}
ifx_free_result ($rid);
?>
PHP Documentation Group IFX_FETCH_ROW(3)