Take and delete a String from another String
I have original input string= 111100001111
I need to Take for example the least 4 bits .... Output= 1111
and to be removed from the original input string so the original input string= 11110000
I am trying to make a generic one but the point is that I can not delete subset that I take from the original input String.
How can I take and delete from a string in the same time?
Solved!
Go to Solution.
Something like this?
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
Attachments:
Split String.png 13 KB
Similar Messages
-
Checking for an element in a string from another string
Hi Guru's,
I have 2 comma seperated strings. Say like this.
a VARCHAR2(100) := '1,2,3,4,5,6,7,8,9,10';
b VARCHAR2(100) := '2,6,9';
My requirement is like I want to check the string a, whether it has any of the element in b. I am trying to use the regular expression. But I was not able to do it.
Kindly help me.
Regards,
VJSQL> var cur refcursor
SQL> declare
a varchar2 (100) := '1,2,3,4,5,6,7,8,9,10';
b varchar2 (100) := '2,6,9';
begin
open :cur for 'select column_value common
from table (sys.dbms_debug_vc2coll (' || a || ') multiset intersect sys.dbms_debug_vc2coll (' || b || '))';
end;
PL/SQL procedure successfully completed.
SQL> print
COMMON
2
6
9
3 rows selected. -
Extracting string from another string
Hi,
I have a problem that I am having difficulty solving, if anyone has any bright ideas it would be a great help.
I have a description field in one of my tables and the description would read something like
my website can be found at www.mywebsite.com, and it is great
I want to be able to extract the web address from this sentance, so the result would be
www.mywebsite.com
I can do this specific for one sentance but I can't find a way to do it for many different sentances.
cheers in advancer u expecting this..?
select substr('my web site is www.abcd.com and u can...',instr('my web site is www.abcd.com and u can...','www.',1),instr(substr('my web site is www.abcd.com and u can...',instr('my web site is www.abcd.com and u can...','www.',1)),' ',1)) from dual; -
Call String from another method
hey,
Im pretty new to java and Im having problems with calling a String from another method
I have two public voids, in one of them I have a String which I wanna use in another method.
Thankshere is some of my code:
public void getOrder() {
try {
DocumentBuilderFactory docBuilderFactory = DocumentBuilderFactory.newInstance();
DocumentBuilder docBuilder = docBuilderFactory.newDocumentBuilder();
Document doc = docBuilder.parse(new File("c:/orders.xml"));
// normalize text representation
doc.getDocumentElement().normalize();
System.out.println("Root element of the doc is " + doc.getDocumentElement().getNodeName());
// lees orders
NodeList orderlijst = doc.getElementsByTagName("order_naam");
System.out.println("totale aantal orders : " + orderlijst.getLength());
// Element orderitem = (Element) orderlijst.item(0);
System.out.println("name=" + doc.getElementsByTagName("order_naam").item(0).getFirstChild().getNodeValue());
String st =doc.getElementsByTagName("order_naam").item(0).getFirstChild().getNodeValue();
public void createGUI () {
this.removeAll();
lbltest = new JLabel();
lbltest.setBounds(20, 40, 150, 20);
lbltest.setFont(new Font("Verdana", Font.BOLD, 12));
this.add(lbltest);
i want to use the String st in the jLabel in createGUI -
To read string from another file
Dear friends
I am working on a project where i need to read log files which are there on my C drive.
I got a folder and from that i need to read string from another folder and name them as URL,TS etc..so any body have any idea about this...I have no idea what you're even trying to do. Can you try explaining your problem more clearly and in more detail?
-
how long does it take to delete an account from a macbook (OSX 10.9.4)? I used secure delete (at the recommendation of the apple genius) and it has already taken 2 weeks... and still not deleted! Granted there was over 200GB of data... any ideas on this? thanks
how long does it take to delete an account from a macbook (OSX 10.9.4)? I used secure delete (at the recommendation of the apple genius) and it has already taken 2 weeks... and still not deleted! Granted there was over 200GB of data... any ideas on this? thanks
-
Replace a string with another string in a file
I have to replace a string with another string. Say for example in a html file it got a line like,
<a href="##"></a>
now i want to replace this ## with the full derived path like
"c;\\sample folder\\sample subfolder\\samplefile.html"
can someone help me to do this?
pls tell me from the file opening till closing the file.I have to replace a string with another string. Say
for example in a html file it got a line like,
<a href="##"></a>
now i want to replace this ## with the full derived
path like
"c;\\sample folder\\samplesubfolder\\samplefile.html"
can someone help me to do this?
pls tell me from the file opening till closing the
file.
public class Buckel {
final static String CONST = "c:\\sample folder\\samplesubfolder\\samplefile.html";
public Buckel() {
public static void main ( String[] argv ) throws Exception {
int idx = 0;
String in = "<a href=\"##\"></a>", // We'll imagine this just gets here somehow. If it's on the i/p file then take the '\' out B4 and aft the '##'.
out = "";
idx = in.indexOf( "##" );
if ( idx > 0 ) {
out = in.substring( 0, idx ) + CONST + in.substring( idx+=2, in.length() );
System.out.println( out );
} -
How to search and delete an email from the mailbox
hi,
have a hybrid scenario, exchange 2013 and office 365
what command should I use to search and delete an email from the organization mailbox i.e. I do not want that email to be in any users inbox.
I have tried this command but it does not work, it says search-mailbox is not recognized as the name of the command let.
Get-Mailbox -ResultSize unlimited | Search-Mailbox -SearchQuery 'Subject:"Download this file"' -DeleteContent
kindly assist.
Kind Regards, Khuzema R.Hi Khuzema
This can be accomplished by search-mailbox command
First you need to create a new role group
To Create – New-RoleGroup “Mailbox Import-Export Management” -Roles “Mailbox Import Export”
Then add the user to the group
To Add user – Add-RoleGroupMember “Mailbox Import-Export Management” -Member Administrator
Search the mailbox
get-mailbox -ResultSize unlimited -IgnoreDefaultScope | search-mailbox -SearchQuery ‘Subject:”virus infected”’ -LogOnly -TargetMailbox administrator -TargetFolder filter -LogLevel Full
Now we need to run the below command to search the infected emails and delete all of them in the whole organization
get-mailbox -ResultSize unlimited -IgnoreDefaultScope | search-mailbox -SearchQuery ‘Subject:”virus infected”’ -TargetMailbox administrator -TargetFolder filter -deletecontent -LogLevel Full
Also you can do a message tracking with the subject and delete them
Get-ExchangeServer | where {$_.isHubTransportServer -eq $true -or $_.isMailboxServer -eq $true} | Get-MessageTrackingLog -Messagesubject “Virus Infected” | Select-Object Timestamp,ServerHostname,ClientHostname,Source,EventId,Recipients
| Sort-Object -Property Timestamp
I have written a blog with regards to the same. You can always refer this which might mostly help you in your scenario
http://exchangequery.com/2014/10/16/steps-to-delete-circulated-suspicious-emails-with-search-mailbox/
Thanks
Remember to mark as helpful if you find my contribution useful or as an answer if it does answer your question.That will encourage me - and others - to take time out to help you Check out my latest blog posts on http://exchangequery.com Thanks Sathish
(MVP) -
How do I find and delete unauthorized songs from my computer?
How do I find and delete unauthorized songs from my computer?
Terence,
Yes, the duplicates appear in the iPhoto window. I have folders with same name occuring two or even three times sometimes with exactly the same set of photos (ie photos with the same ID) and sometimes with a limited set of photos. Other folders appear only once.
I normally take my MacBook with me if I'm shooting a lot of photos, such as on holiday, and then want to transfer them to my iMac when i get home. Other times I transfer the camera's memory stick directly to my iMac.
I have great difficulty transferring the photos from my MacBook to my iMac. I don't want to store my photos on my iDisk due to the length of time it takes to upload them.
Thanks again.
Simon -
Replacing a special character in a string with another string
Hi
I need to replace a special character in a string with another string.
Say there is a string - "abc's def's are alphabets"
and i need to replace all the ' (apostrophe) with &apos& ..which should look like as below
"abc&apos&s def&apos&s are alphabets" .
Kindly let me know how this requirement can be met.
Regards
SukumariREPLACE
Syntax Forms
Pattern-based replacement
1. REPLACE [{FIRST OCCURRENCE}|{ALL OCCURRENCES} OF]
pattern
IN [section_of] dobj WITH new
[IN {BYTE|CHARACTER} MODE]
[{RESPECTING|IGNORING} CASE]
[REPLACEMENT COUNT rcnt]
{ {[REPLACEMENT OFFSET roff]
[REPLACEMENT LENGTH rlen]}
| [RESULTS result_tab|result_wa] }.
Position-based replacement
2. REPLACE SECTION [OFFSET off] [LENGTH len] OF dobj WITH new
[IN {BYTE|CHARACTER} MODE].
Effect
This statement replaces characters or bytes of the variable dobj by characters or bytes of the data object new. Here, position-based and pattern-based replacement are possible.
When the replacement is executed, an interim result without a length limit is implicitly generated and the interim result is transferred to the data object dobj. If the length of the interim result is longer than the length of dobj, the data is cut off on the right in the case of data objects of fixed length. If the length of the interim result is shorter than the length of dobj, data objects of fixed length are filled to the right with blanks or hexadecimal zeroes. Data objects of variable length are adjusted. If data is cut off to the right when the interim result is assigned, sy-subrc is set to 2.
In the case of character string processing, the closing spaces are taken into account for data objects dobj of fixed length; they are not taken into account in the case of new.
System fields
sy-subrc Meaning
0 The specified section or subsequence was replaced by the content of new and the result is available in full in dobj.
2 The specified section or subsequence was replaced in dobj by the contents of new and the result of the replacement was cut off to the right.
4 The subsequence in sub_string was not found in dobj in the pattern-based search.
8 The data objects sub_string and new contain double-byte characters that cannot be interpreted.
Note
These forms of the statement REPLACE replace the following obsolete form:
REPLACE sub_string WITH
Syntax
REPLACE sub_string WITH new INTO dobj
[IN {BYTE|CHARACTER} MODE]
[LENGTH len].
Extras:
1. ... IN {BYTE|CHARACTER} MODE
2. ... LENGTH len
Effect
This statement searches through a byte string or character string dobj for the subsequence specified in sub_string and replaces the first byte or character string in dobj that matches sub_string with the contents of the data object new.
The memory areas of sub_string and new must not overlap, otherwise the result is undefined. If sub_string is an empty string, the point before the first character or byte of the search area is found and the content of new is inserted before the first character.
During character string processing, the closing blank is considered for data objects dobj, sub_string and new of type c, d, n or t.
System Fields
sy-subrc Meaning
0 The subsequence in sub_string was replaced in the target field dobj with the content of new.
4 The subsequence in sub_string could not be replaced in the target field dobj with the contents of new.
Note
This variant of the statement REPLACE will be replaced, beginning with Release 6.10, with a new variant.
Addition 1
... IN {BYTE|CHARACTER} MODE
Effect
The optional addition IN {BYTE|CHARACTER} MODE determines whether byte or character string processing will be executed. If the addition is not specified, character string processing is executed. Depending on the processing type, the data objects sub_string, new, and dobj must be byte or character type.
Addition 2
... LENGTH len
Effect
If the addition LENGTH is not specified, all the data objects involved are evaluated in their entire length. If the addition LENGTH is specified, only the first len bytes or characters of sub_string are used for the search. For len, a data object of the type i is expected.
If the length of the interim result is longer than the length of dobj, data objects of fixed length will be cut off to the right. If the length of the interim result is shorter than the length of dobj, data objects of fixed length are filled to the right with blanks or with hexadecimal 0. Data objects of variable length are adapted.
Example
After the replacements, text1 contains the complete content "I should know that you know", while text2 has the cut-off content "I should know that".
DATA: text1 TYPE string VALUE 'I know you know',
text2(18) TYPE c LENGTH 18 VALUE 'I know you know',
sub_string TYPE string VALUE 'know',
new TYPE string VALUE 'should know that'.
REPLACE sub_string WITH new INTO text1.
REPLACE sub_string WITH new INTO text2. -
I need to append a string to another string
I'm working with some inherited code, I'm a Colf Fusion
novice myself, and I'm trying to make this order form display the
correct data. The problem is a lot of data in the database is
missing. Description in the QStockDB query can contain a lot of
stuff. For our full color work the text "4/0", "4/BLACK", and "4/4"
are consistent so I'm changing the newitem (I know, not very
descriptive but it's not my code) to CMYK Printing.
<cfif #QStockDB.description# contains "4/0"><cfset
newitem = "CMYK Printing"></cfif>
<cfif #QStockDB.description# contains
"4/4/BLACK"><cfset newitem = "CMYK Printing"></cfif>
<cfif #QStockDB.description# contains "4/4"><cfset
newitem = "CMYK Printing"></cfif>
I want to then go back through description and compare it
more to add more description. For instance with this:
<cfif #QStockDB.description# contains "12 pt"><cfset
newitem = newitem + " - BC"></cfif>
I know that the job is a business card. So I want to append
the newitem variable with " - BC". Likewise:
<cfif #QStockDB.description# contains
"catalog"><cfset newitem = newitem + " - Catalog
Sheets"></cfif>
displays CMYK Printing - Catalog Sheets. Or, it should... or,
more precisely, I want it to. :)
How do I append a string to another string?+ is the addiion operator and works with numbers. Because
your string is a ...well, string... you need to use an ampersand.
Thus, instead of:
<cfif #QStockDB.description# contains
"catalog"><cfset newitem = newitem + " - Catalog
Sheets"></cfif>
Use...
<cfif #QStockDB.description# contains
"catalog"><cfset newitem = newitem & " - Catalog
Sheets"></cfif>
<cfoutput>#newitem#</cfoutput>
At least I think that will work - haven't tested it
though. -
Iphoto quit suddenly and deleted todays photos from the MacBook and the phone. Is there any way to retrieve these precious photos? are they on my sd card in the phone?
If they are in an iPod backup, then restore another iPod, iPhone or iPad from that backup
-
Starting and stopping a VI from another VI
Hello
I have to write a VI for starting and stopping a vi from another vi. I browsed the forums for an example but couldn't find one. If anyone has an example it would be of great help.
Thanks
AnkitI may be throwing myself into a pot of boiling water here, but...
I don't think this method is called dynamically calling a VI. Going through the LabVIEW help says this about dynamically called VIs
"You can dynamically load VIs instead of using statically linked subVI calls. A statically linked subVI is one you place directly on the block diagram of a caller VI. It loads at the same time the caller VI loads.
Unlike statically linked subVIs, dynamically loaded VIs do not load until the caller VI loads them with the Open VI Reference. If you have a large caller VI, you can save load time and memory by dynamically loading the VI because the VI does not load until the caller VI needs it, and you can release it from memory after the operation completes. You also can use the VI Call Configuration dialog box to configure when to load the subVI."
and:
"Create a strictly typed VI reference to dynamically call a VI using the Call by Reference Node. The strictly typed VI refnum identifies the connector pane of the VI you are calling."
It seems that the advantage of dynamically calling a VI you can call DIFFERENT VI's with the same function on the block diagram as long as both are strictly typed to have the same connector pane. So say you have a VI that has a voltage input and a time input and calculates the rate of voltage change, could be replaced by a VI that takes the same inputs, but does something else with the data. And both VI's could be called by the same function depending of the reference passed to "Call by Reference."
I think the method of calling a VI and not caring about when it finishes is just an Invoke Node method. -
How do I save and import my bookmarks from another hard drive? When I try to open the installed Firefox on the old drive, it (obviously) opens a browser from the new main drive, free of bookmarks. Is there a way I can save the bookmarks on the old drive without opening a browser?
The guts of my computer were rearranged and I got a new main hard drive. My old one is still in there and I can get stuff from it, but when I go to the Mozilla folder on the old one, I can't figure out if there's anything I can do to get all my bookmarks from that drive to my new one, where Firefox is newly installed.If you open Firefox then Firefox will always use the default profile folder as found via profiles.ini on your system drive.
You either need to import the file in your current default profile or copy the file to your current profile folder while Firefox is closed.
Firefox 3 stores the bookmarks and the browser history in [http://kb.mozillazine.org/places.sqlite places.sqlite] and no longer creates an HTML backup by default.
There are also (five) JSON backups in the bookmarkbackups folder within the Firefox profile folder.
You can either copy the file places.sqlite to your [http://kb.mozillazine.org/Profile_folder_-_Firefox Firefox Profile Folder] or import the most recent JSON backup from the bookmarkbackups folder of that old profile.
See:
http://kb.mozillazine.org/Backing_up_and_restoring_bookmarks_-_Firefox
http://kb.mozillazine.org/Transferring_data_to_a_new_profile_-_Firefox
See http://kb.mozillazine.org/Profile_folder_-_Firefox
"Application Data" in XP/Win2K and "AppData" in Vista/Windows 7 are hidden folders.
See http://kb.mozillazine.org/Show_hidden_files_and_folders
Go to: Control Panel > Folder Options > "View" tab > under "Hidden files and folders", select "Show hidden files and folders".
You may want to un-check the box "Hide extensions for known file types" to see the file extensions of all files. -
What would happen if I turn off my backup and delete backup data From my device? Will it delete my music and everything for ever or just stay in the cloud but not on my device?
If you have multiple devices backing up to the Cloud, you will see all of them listed. You would click on each device to change what is backed up from that device. You can then delete your individual back-ups.
Once you have all your settings to your liking, you can then go back to Settings>iCloud>Storage & Backup, and click on Back Up Now (bottom of the screen) to create a fresh backup with your new settings.
Cheers,
GB
Maybe you are looking for
-
I have a corrupt Photo file, that makes Aperture stop working properly.
I recently imported some of my old photos from a CD to the Aperture Library. Every time I open that project or try to work with any of those photos Aperture will stop working. (in a very aggressive way) The viewer wont update.! It wont make any chang
-
How to change the semantic color of entire rows in a table.
Hi, in the past I already managed to change the semantic color of a cell by a condition (for example all the cells with negative number -> I set negative semantic color) My question is how can I change the semantic color of the entire row where this
-
Distributing software with unlimited strength JCE policy files
I'm about to release some software that uses AES 256-bit encryption. I had to download the "Java Cryptography Extension (JCE) Unlimited Strength Jurisdiction Policy Files 6" to do this level of encryption. I'd like to distribute my software with a bu
-
Doubled list of Develop Presets in Import dialog?
Hi all, I'm running a week-old trial copy of LR3.3 on Windows, and I seem to have a doubled set of Develop Presets in the Import dialog's 'Apply During Import' dropdown menu. However, I just get the single list in the Presets panel of the Develop mod
-
How do I close the vertical bookmarks listing that is in my browsing window?
How do I close the vertical bookmarks listing that is in my browsing window?