Hi radoulov, this would be equivalent to this no?
The first will also delete spaces in fields
The second is only for 4 fields
You would have to do something like this to get rid of spurious whitespace:
Hi all,
I have a spreadsheet with 20 fields(columns) in which the fifth column is a numerical column with records such as 00024,00455, 00234,556670,465700,00456 etc. I want to consider the leading zeros for this column so that I can use some logic. Now the problem is that I am unable to add... (3 Replies)
Hi, I am looking for a unix command which inserts double quotes around all values in a text file. For example,
Input:
1234 200 4686 3506056
9646 457 5647 5066762
5656 366 5869 5978459
Output:
"1234" "200" "4686" "3506056"
"9646" "457" "5647" "5066762"
"5656" "366" "5869"... (2 Replies)
How do I execute a command containing a double quote ?
I pass a variable to grep that contains spaces, so I need to quote it,
but it does not work.
#!/usr/bin/ksh
set -x
txt='"next to"'
cmd="grep $txt ~dpearso5/file2"
echo $cmd
$cmd
This is the error I get:
+ grep "next to"... (1 Reply)
Hi,
Can you please help me?
How to Parse a comma delimited and optionally quotes dimilited file?
sample.dat
----------
"I",+2007,"SANDA, 20, MARTIN PLACE","SANDA 20MARTIN"
"D",+2008,"RANDA, 22, MARTIN PLACE","RANDA 22MARTIN"
Thank you.
Ram (8 Replies)
Hello,
Can someone help me to do this with awk or sed? I have a file with multiple lines, each line has many fields separated with a tab. I would like to add one more field holding 'na' in between the first and second fields.
old file looks like,
1, field1 field2 field3 ...
2, field1... (7 Replies)
In a bash script, I need to pass a parameter that has space in-between using double quotes as follows:
CMD="SomeExecutable"
# Parameter that has a space in-between
PARAM1="TIMO 2"
CMD_IN="--name=\"$PARAM1\""
CMD_OUT=`$CMD $CMD_IN`
expected/required command execution:... (4 Replies)
Hi Unix Gurus..
I am new to Unix. Please help me. The file I am getting is as follows:
Input File
"2011-07-06 03:53:23","0","I","NOT SET ",,,,"123985","SAW CUT CONCRETE SLAB 20"THICK",,"98.57","","EACH","N"
"2011-07-06 03:53:23","0","I","NOT SET ",,,,"204312","ARMAFLEX-1 3/8 X... (2 Replies)
I have a csv data file :
A,B,C,D,"A,B",E,"GG,H"
E,F,G,H,I,J,"S,P"
I need to replace all "," with "|" except the ones between double quotes i.e
A|B|C|D|"A,B"|E|"GG,H"
E|F|G|H|I|J|"S,P"
CAn someone assist? (8 Replies)
Hi All,
I'm unable to load the data using sql loader where there are double quotes within the double quotes As these are optionally enclosed by double quotes.
Sample Data :
"221100",138.00,"D","0019/1477","44012075","49938","49938/15043000","Television - 22" Refurbished - Airwave","Supply... (6 Replies)
Please help me to use echo or printf type of command to print some value from variable within double quotes - I want to print the double quote ( " ") also.
I tried
#!/bin/bash
VALUE=some_value
echo '{"value" : "$VALUE"}'
I was expecting the above script would produce ..
{"value" :... (3 Replies)
Discussion started by: atanubanerji
3 Replies
LEARN ABOUT PHP
htmlspecialchars_decode
HTMLSPECIALCHARS_DECODE(3) 1 HTMLSPECIALCHARS_DECODE(3)htmlspecialchars_decode - Convert special HTML entities back to charactersSYNOPSIS
string htmlspecialchars_decode (string $string, [int $flags = ENT_COMPAT | ENT_HTML401])
DESCRIPTION
This function is the opposite of htmlspecialchars(3). It converts special HTML entities back to characters.
The converted entities are: &, " (when ENT_NOQUOTES is not set), ' (when ENT_QUOTES is set), < and >.
PARAMETERS
o $string
- The string to decode.
o $flags
- A bitmask of one or more of the following flags, which specify how to handle quotes and which document type to use. The default
is ENT_COMPAT | ENT_HTML401.
Available $flags constants
+--------------+---------------------------------------------------+
|Constant Name | |
| | |
| | Description |
| | |
+--------------+---------------------------------------------------+
| | |
| ENT_COMPAT | |
| | |
| | Will convert double-quotes and leave single- |
| | quotes alone. |
| | |
| | |
| ENT_QUOTES | |
| | |
| | Will convert both double and single quotes. |
| | |
| | |
|ENT_NOQUOTES | |
| | |
| | Will leave both double and single quotes uncon- |
| | verted. |
| | |
| | |
| ENT_HTML401 | |
| | |
| | Handle code as HTML 4.01. |
| | |
| | |
| ENT_XML1 | |
| | |
| | Handle code as XML 1. |
| | |
| | |
| ENT_XHTML | |
| | |
| | Handle code as XHTML. |
| | |
| | |
| ENT_HTML5 | |
| | |
| | Handle code as HTML 5. |
| | |
+--------------+---------------------------------------------------+
RETURN VALUES
Returns the decoded string.
CHANGELOG
+--------+---------------------------------------------------+
|Version | |
| | |
| | Description |
| | |
+--------+---------------------------------------------------+
| 5.4.0 | |
| | |
| | The constants ENT_HTML401, ENT_XML1, ENT_XHTML |
| | and ENT_HTML5 were added. |
| | |
+--------+---------------------------------------------------+
EXAMPLES
Example #1
A htmlspecialchars_decode(3) example
<?php
$str = "<p>this -> "</p>
";
echo htmlspecialchars_decode($str);
// note that here the quotes aren't converted
echo htmlspecialchars_decode($str, ENT_NOQUOTES);
?>
The above example will output:
<p>this -> "</p>
<p>this -> "</p>
SEE ALSO htmlspecialchars(3), html_entity_decode(3), get_html_translation_table(3).
PHP Documentation Group HTMLSPECIALCHARS_DECODE(3)