I have a script which loop through a directory then report any file matches the given pattern,
say, the pattern is "a2006", this file would be returned
a20061101.txt
I would like to know how can I get the remaining of the filename, so
a20061101txt - a2006 = 1101.txt
Can anybody help? Thank... (2 Replies)
I was using the following bash command inside the emacs compile command to search C++ source code:
grep -inr --include='*.h' --include='*.cpp' '"' * | sed "/include/d" | sed "/_T/d" | sed '/^ *\/\//d' | sed '/extern/d'
Emacs will then position me in the correct file and at the correct line... (0 Replies)
I know this should be simple, but I've been manning sed awk grep and find and am stupidly stumped :(
I'm trying to use sed (or awk, find, etc) to find 4 characters on the second line of a file.txt 44-47 characters in. I can find lots of sed things for lines, but not characters. (4 Replies)
how can i print all the chars of a string one by line?
i have thought that use a for cicle and use this command inside:
${VARIABLE:0:last}but how can i make last? because string is random
P.S. VARIABLE is the string
or can i make a variable for every chars of this string?
this was my idea... (10 Replies)
Hi, I'm having trouble with awk print all characters between 2 patterns. I tried more then one solution found on this forum but with no success.
Probably my mistakes are due to the special characters "" and "]"in the search patterns.
Well, have a log file like this:
logfile.txt
... (3 Replies)
Hi All,
This might be a basic question... I need to write a script to find all/any Speacial/Null/Control Chars and Print Line Numbers from an input file.
Output something like
Null Characters in File Name at : Line Numbers
Line = Print the line
Control Characters in File Name at : Line... (2 Replies)
I know that it is possible to login into the HMC console and view all the specs like, how much CPU/RAM every LPAR has.
But how can I check how much the whole P7 has in total and how much is left to creat a new LPAR:wall: (5 Replies)
For a given string that may contain any ASCII chars, i.e. that matches .*,
find and print only the chars that are in a given subset.
The string could also have numbers, uppercase, special chars such as ~!@#$%^&*(){}\", whatever a user could type in
without going esoteric
For simplicity take... (1 Reply)
Hi Team,
I have a file a1.txt with data as follows.
dfjakjf...asdfkasj</EnableQuotedIDs><SQL><SelectStatement modified='1' type='string'><!
The delimiter string: <SelectStatement modified='1' type='string'><!
dlm="<SelectStatement modified='1' type='string'><!
The above command is... (7 Replies)
Discussion started by: kmanivan82
7 Replies
LEARN ABOUT REDHAT
html::entities
HTML::Entities(3) User Contributed Perl Documentation HTML::Entities(3)NAME
HTML::Entities - Encode or decode strings with HTML entities
SYNOPSIS
use HTML::Entities;
$a = "Våre norske tegn bør æres";
decode_entities($a);
encode_entities($a, "200-377");
DESCRIPTION
This module deals with encoding and decoding of strings with HTML character entities. The module provides the following functions:
decode_entities($string)
This routine replaces HTML entities found in the $string with the corresponding ISO-8859/1 (or with perl-5.7 or better Unicode) charac-
ter. Unrecognized entities are left alone.
encode_entities($string, [$unsafe_chars])
This routine replaces unsafe characters in $string with their entity representation. A second argument can be given to specify which
characters to concider as unsafe. The default set of characters to expand are control chars, high-bit chars and the '<', '&', '>' and
'"' characters.
Both routines modify the string passed as the first argument if called in a void context. In scalar and array contexts the encoded or
decoded string is returned (and the argument string is left unchanged).
If you prefer not to import these routines into your namespace you can call them as:
use HTML::Entities ();
$encoded = HTML::Entities::encode($a);
$decoded = HTML::Entities::decode($a);
The module can also export the %char2entity and the %entity2char hashes which contain the mapping from all characters to the corresponding
entities.
COPYRIGHT
Copyright 1995-2001 Gisle Aas. All rights reserved.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
perl v5.8.0 2001-11-05 HTML::Entities(3)