09-05-2011
vi and special character removal
To the group, when I copy text from a web page that has the below java code , and then do the set list command in the vi editor, I see the $ symbol at the end of each line. I have searched the internet looking for a way to remove this from the file since it will not compile without errors..Please help...
thank you
steve
class TapeDeck {$
boolean canRecord = false;$
void playTape() {$
System.out.println(“tape playing”);$
}$
void recordTape() {$
System.out.println(“tape recording”);$
}$
}$
class TapeDeckTestDrive {$
public static void main(String [] args) {$
t.canRecord = true;$
t.playTape();$
if (t.canRecord == true) {$
t.recordTape();$
}$
}$
}$
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi,
I am trying to unload file from a database. Which contains few lines with the character below. Rest of the data was unloaded appropriately.
a) What does this below character means?
b) How can i remove it,
I already have sed '/^$/d'
c) Will this effect the file by any means... (4 Replies)
Discussion started by: tostay2003
4 Replies
2. Shell Programming and Scripting
I have a script that produces an output containing '/.ssh'.
I am trying to find a way of parsing only this data from a single line, without removing any other special characters contained within the output as a result of the parse.
Any help would be appreciated (6 Replies)
Discussion started by: Raggedranger333
6 Replies
3. Shell Programming and Scripting
I have below line in a unix file, I want to delete one character after "Â".
20091020.Non-Agency CMO Daily Trade Recap Â~V Hybrids
The result should be :
20091020.Non-Agency CMO Daily Trade Recap  Hybrids
i dont want to use "~V" anywhere in the sed command or any other command, just remove... (1 Reply)
Discussion started by: mohsin.quazi
1 Replies
4. Shell Programming and Scripting
Hi,
Could you please help me in removal of newline chracter present in between the double quotes and replacing it with space.
For example ...
Every field is wrapped with double quotes with comma delimiter, so I need to travese from first double quote occerence to till second double... (7 Replies)
Discussion started by: vsairam
7 Replies
5. Shell Programming and Scripting
I'd like to remove (do a pattern or precise replacement - this I can handle in SED using Regex )
---AFTER THE 1ST Occurrence ( i.e. on the 2nd occurrence - from the 2nd to fourth occurance ) of a specific string : type 1
-- After the 1st occurrence of 1 string1 till the 1st occurrence of... (4 Replies)
Discussion started by: sieger007
4 Replies
6. Shell Programming and Scripting
Hello
I've got a string of text with a number in pence, e.g. 0.52p, I need to remove the 'p' so that it just reads 0.52 without of course removing all the other 'p' characters.
Many thanks (1 Reply)
Discussion started by: mrpugster
1 Replies
7. Shell Programming and Scripting
When editing a file, vi displays a special character as ^L. Can you tell me the escaped character to be used in awk? And can that escaped character be used in a regexp in both sed and awk? (7 Replies)
Discussion started by: dmesserly
7 Replies
8. Shell Programming and Scripting
Hi,
The command - id | awk '{print $1}' - returns the following:
uid=9028(luke)
What do I need to further that awk so that I only have "luke", I want to set this as a variable.
Thanks in advance,
Lukas.
P.S: I've come up with:
USER1=`id | awk F'(' '{print $2}' | awk -F')' '{print... (4 Replies)
Discussion started by: luke222010
4 Replies
9. Shell Programming and Scripting
can anyone share script for how to remove control m character (1 Reply)
Discussion started by: pw227j
1 Replies
10. UNIX for Beginners Questions & Answers
Hi,
on ksh
What does the following do?
grep -v "toolbox" $home_oracle/.profile >$home_oracle/.profile.$$ Thanks.
Please use CODE tags as required by forum rules! (3 Replies)
Discussion started by: big123456
3 Replies
LEARN ABOUT PHP
splobjectstorage
SPLOBJECTSTORAGE(3) 1 SPLOBJECTSTORAGE(3)
The SplObjectStorage class
INTRODUCTION
The SplObjectStorage class provides a map from objects to data or, by ignoring data, an object set. This dual purpose can be useful in
many cases involving the need to uniquely identify objects.
CLASS SYNOPSIS
SplObjectStorage
SplObjectStorageCountableIteratorSerializableArrayAccess
Methods
o public void SplObjectStorage::addAll (SplObjectStorage $storage)
o public void SplObjectStorage::attach NULL (object $object, [mixed $data])
o public bool SplObjectStorage::contains (object $object)
o public int SplObjectStorage::count (void )
o public object SplObjectStorage::current (void )
o public void SplObjectStorage::detach (object $object)
o public string SplObjectStorage::getHash (object $object)
o public mixed SplObjectStorage::getInfo (void )
o public int SplObjectStorage::key (void )
o public void SplObjectStorage::next (void )
o public bool SplObjectStorage::offsetExists (object $object)
o public mixed SplObjectStorage::offsetGet (object $object)
o public void SplObjectStorage::offsetSet NULL (object $object, [mixed $data])
o public void SplObjectStorage::offsetUnset (object $object)
o public void SplObjectStorage::removeAll (SplObjectStorage $storage)
o public void SplObjectStorage::removeAllExcept (SplObjectStorage $storage)
o public void SplObjectStorage::rewind (void )
o public string SplObjectStorage::serialize (void )
o public void SplObjectStorage::setInfo (mixed $data)
o public void SplObjectStorage::unserialize (string $serialized)
o public bool SplObjectStorage::valid (void )
EXAMPLES
Example #1
SplObjectStorage as a set
<?php
// As an object set
$s = new SplObjectStorage();
$o1 = new StdClass;
$o2 = new StdClass;
$o3 = new StdClass;
$s->attach($o1);
$s->attach($o2);
var_dump($s->contains($o1));
var_dump($s->contains($o2));
var_dump($s->contains($o3));
$s->detach($o2);
var_dump($s->contains($o1));
var_dump($s->contains($o2));
var_dump($s->contains($o3));
?>
The above example will output:
bool(true)
bool(true)
bool(false)
bool(true)
bool(false)
bool(false)
Example #2
SplObjectStorage as a map
<?php
// As a map from objects to data
$s = new SplObjectStorage();
$o1 = new StdClass;
$o2 = new StdClass;
$o3 = new StdClass;
$s[$o1] = "data for object 1";
$s[$o2] = array(1,2,3);
if (isset($s[$o2])) {
var_dump($s[$o2]);
}
?>
The above example will output:
array(3) {
[0]=>
int(1)
[1]=>
int(2)
[2]=>
int(3)
}
PHP Documentation Group SPLOBJECTSTORAGE(3)