10-01-2008
For each line in your file,
split the string into an array
grab the first two array variables - do your math / substitution
merge it back into a string
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Does anyone know if there any application perform better than Exceed? It seems some video card doesn't support Exceed.
thx (1 Reply)
Discussion started by: E-Quality
1 Replies
2. Shell Programming and Scripting
Can anyone tell me how to read a file in perl having junk characters . I have only one junk character which is repeated many times in the file. While i'm reading and printing the file , it is displaying till the 1st occurence of that junk character and rest of the file is not being read. (1 Reply)
Discussion started by: k_surya
1 Replies
3. Shell Programming and Scripting
Hi,
I am trying to separate the directory from the filename using the substring and it does not like it.
$Complete_name="C:\ABCD\Reports_Split\090308.1630"
I want $File_Name as 090308.1630
I tried using Substring function and it does not like slashes in the complete_name.
Any... (5 Replies)
Discussion started by: sushma0907
5 Replies
4. Shell Programming and Scripting
Hi,
Here is my piece of code--
sub per_user_qna_detail
{
for($index=0;$index<@records;$index++)
{
if($records =~ m/^(.*)\s*Morocco.*Entering\s*Module::authenticate/)
{
printf "INSIDE per_user_qna_detail on LINE NO $index\n";
$Time_Stamp = $1;... (0 Replies)
Discussion started by: namishtiwari
0 Replies
5. Shell Programming and Scripting
Guys,
can you help me in removing the junk character "^S" from the below line using perl
Reference Data Not Recognised ^S Where a value is provided by the consuming system, which is not reco
Thanks,
M.Mohan (1 Reply)
Discussion started by: mohan_xunil
1 Replies
6. Shell Programming and Scripting
greetings citizens of Unix.com
I am perplexed with an issue.
The issue is trying to print the last 5 characters of a string in PERL.
Below are demonstrated my daft attempts at performing the forementioned task.
$row =~ m/^.*(.....)\s$/;
$row =~ m/\w{5}\s*$/i;$row =~... (3 Replies)
Discussion started by: simply seth
3 Replies
7. Shell Programming and Scripting
Hi All,
I have a word "DE_PR_Package__Basic" , i need to check if the first two characters of this words is DE or something else using perl script.
Can anyone pls let me know how to proceed?
Thanks in advance.
Giri! (3 Replies)
Discussion started by: girish.raos
3 Replies
8. Shell Programming and Scripting
Hello all
I have a string like
" Have Fun for the rest of the day !. I will meet you tomorrow!"
! is the HTML Equivalent of ! symbol.
From the above string, i would like to remove only the HTML encoded special characters.
Output should be like
" Have Fun for the rest of the day... (4 Replies)
Discussion started by: vasuarjula
4 Replies
9. Shell Programming and Scripting
I am completely new to perl programming. My father is helping me learn said programming language. However, I am stuck on one of the assignments he has given me, and I can't find very much help with it via google, either because I have a tiny attention span, or because I can be very very dense.
... (4 Replies)
Discussion started by: kittyluva2
4 Replies
10. Shell Programming and Scripting
Hello. I've been thinking about how to go about this. I know I'm close but still does not work. I need to remove any word in that is not at least 2 characters long. I've removed all the non-alphabetic characters already (numbers included). Here's an example:
my $string = "This string is a... (4 Replies)
Discussion started by: D2K
4 Replies
LEARN ABOUT SUSE
xml::dom::characterdata
XML::DOM::CharacterData(3) User Contributed Perl Documentation XML::DOM::CharacterData(3)
NAME
XML::DOM::CharacterData - Common interface for Text, CDATASections and Comments
DESCRIPTION
XML::DOM::CharacterData extends XML::DOM::Node
The CharacterData interface extends Node with a set of attributes and methods for accessing character data in the DOM. For clarity this set
is defined here rather than on each object that uses these attributes and methods. No DOM objects correspond directly to CharacterData,
though Text, Comment and CDATASection do inherit the interface from it. All offsets in this interface start from 0.
METHODS
getData and setData (data)
The character data of the node that implements this interface. The DOM implementation may not put arbitrary limits on the amount of
data that may be stored in a CharacterData node. However, implementation limits may mean that the entirety of a node's data may not fit
into a single DOMString. In such cases, the user may call substringData to retrieve the data in appropriately sized pieces.
getLength
The number of characters that are available through data and the substringData method below. This may have the value zero, i.e.,
CharacterData nodes may be empty.
substringData (offset, count)
Extracts a range of data from the node.
Parameters:
offset Start offset of substring to extract.
count The number of characters to extract.
Return Value: The specified substring. If the sum of offset and count exceeds the length, then all characters to the end of the data
are returned.
appendData (str)
Appends the string to the end of the character data of the node. Upon success, data provides access to the concatenation of data and
the DOMString specified.
insertData (offset, arg)
Inserts a string at the specified character offset.
Parameters:
offset The character offset at which to insert.
arg The DOMString to insert.
deleteData (offset, count)
Removes a range of characters from the node. Upon success, data and length reflect the change. If the sum of offset and count exceeds
length then all characters from offset to the end of the data are deleted.
Parameters:
offset The offset from which to remove characters.
count The number of characters to delete.
replaceData (offset, count, arg)
Replaces the characters starting at the specified character offset with the specified string.
Parameters:
offset The offset from which to start replacing.
count The number of characters to replace.
arg The DOMString with which the range must be replaced.
If the sum of offset and count exceeds length, then all characters to the end of the data are replaced (i.e., the effect is the same as
a remove method call with the same range, followed by an append method invocation).
perl v5.12.1 2000-01-31 XML::DOM::CharacterData(3)