How to Remove Text From Strings ?
Hi,
The question I have is, in the String that I have Pasted below, how can I remove the first line (>gi|23821530|dbj||SEG_D10989S Bos taurus gene for endothelin receptor) and then use the remainder of the text to Post to a web server?
I have tried doing this with a Regex (Pattern P = Pattern.compile("(^>.*)");), I'm able to capture the first line of text, but am not sure how to remove it and then use the rest of the text to Post to the web server.
Any Help with this would be much appreciated
gi|23821530|dbj||SEG_D10989S Bos taurus gene for endothelin receptorGGGATCCCGAGCAAACTGCGGAGGCCACACTGTCAGGCATTCCCTCGGCGTTTCGTCAGAGCCAGACCCT
CCCGCTGCTGAAGGGAGGCGCGCTCTGCTCCCGGGCTGCCGGGAACCCAGCCGCGCGCCGGGGAAGGAGG
TCCCTGCCTGGTGCGTCCGGACCAAGAGGTAACCGTTCTGCTTGGTGTTTAATTCAAATCTGTGATTGAA
CCTTATCCTGGGGCTTCAGTTTGGATTACTTCTTAGGTTTGTTTTTGTTTGTTTGTTTGTTTTTTAACCT
GTAGCTACAGCAGATTAAAATGGGATTGGAGTGAAGGAGAGGGCTTGAGTGTCTGAAGTCACTCGAAGGG
GATAGAAACTTCCGAGTTAATCCAGATAGAGACTCTTCCAAATAGACCAAGTGGAGATGTCCGGGAGATT
TTCCGAGTCAGCCGGCTCAGTCCTGGGGTGTGTGTATGGGGGGTGGGGGCGGTGCCGAAGAGCGGAAGGA
AGGGGTCTGAAAGTCCAGACATGCGGCATCCGGGGTTGCTGTGGAGTCGAAAGCAGAGACTGGCGATGCC
CTTGATCTCTAACCTGCCTTGATTTGCCCCGTCCCCGCGCGCCCTTGGCCAGAACGAATACTGCTCCCTC
TGCGCACACCAGGAGCTCAAAGCTTTGCTTTGGACACCCGTCCTCTCCTCCCCGTCACACCCCTTCCAGG
String foo = "gi|23821530|dbj||SEG_D10989S Bos taurus
gene for endothelin receptor";
String totalString = "gi|23821530|dbj||SEG_D10989S Bos
taurus gene for endothelin receptor
GGGATCCCGAGCAAACTGCGGAGGCCACACTGTCAGGCATTCCCTCGGCGTTTCG
CAGAGCCAGACCCT
CCCGCTGCTGAAGGGAGGCGCGCTCTGCTCCCGGGCTGCCGGGAACCCAGCCGCG
GCCGGGGAAGGAGG
TCCCTGCCTGGTGCGTCCGGACCAAGAGGTAACCGTTCTGCTTGGTGTTTAATTC
AATCTGTGATTGAA
CCTTATCCTGGGGCTTCAGTTTGGATTACTTCTTAGGTTTGTTTTTGTTTGTTTG
TTGTTTTTTAACCT
GTAGCTACAGCAGATTAAAATGGGATTGGAGTGAAGGAGAGGGCTTGAGTGTCTG
AGTCACTCGAAGGG
GATAGAAACTTCCGAGTTAATCCAGATAGAGACTCTTCCAAATAGACCAAGTGGA
ATGTCCGGGAGATT
TTCCGAGTCAGCCGGCTCAGTCCTGGGGTGTGTGTATGGGGGGTGGGGGCGGTGC
GAAGAGCGGAAGGA
AGGGGTCTGAAAGTCCAGACATGCGGCATCCGGGGTTGCTGTGGAGTCGAAAGCA
AGACTGGCGATGCC
CTTGATCTCTAACCTGCCTTGATTTGCCCCGTCCCCGCGCGCCCTTGGCCAGAAC
AATACTGCTCCCTC
TGCGCACACCAGGAGCTCAAAGCTTTGCTTTGGACACCCGTCCTCTCCTCCCCGT
ACACCCCTTCCAGG";
int position = -1;
int lenght = -1;
position = totalString.indexOf(foo) + foo.length();
String processedString =
totalString.substring(position);
Thanks for the post,
Did the job perfectly!
cheers again
Similar Messages
-
How to remove text from .swf animation?
how to remove text from .swf animation? Can no find this text
in fla file. Flash 8.exactly what 'text' are you referring to? text that you typed
on the Stage using the 'textTool'? simply select the text with the
'arrowTool' and hit delete.
If you are referring to a textField that you want to
eliminate after a certain amount of time, within your animation
sequence. first copy the text, create a new layer, paste the text
in place, then where you want to have the text 'disappear' insert a
'blank keyframe' at that point in the text layer.
OR place the textfield within a MC and remove it with code.
OR if the text is dynamic and you wish to use the position at a
later time, pass a value of null or and empty string to the field
at the point you wish. And there are other ways still. :) hope one
of these works for you. -
How to remove text from photo only one layer?
How do I remove text from this photo? plz & ty
o I remove text from a photo?Contact the person who took the photo and ask for a clean copy.
If you don't know the photographer, chances are good that your use of the photo would be a violation of copyright. -
AOA
How to remove the text from cells of JPanel. Just to refresh the GUI.
regardsHow to provide meaningful subject?
The subject of this thread does not match what you are asking in the body.
To set the value of a cell in a JTable, you can simply call setValueAt().
Read the API to find the method parameters. -
How to remove text from mp4 video
hi all,
i have a mp4 video of 30 seconds.
the video has a text appearing on left side and bottom of the video.
i want to remove that text using premiere but im very new to video editing.
any steps of "how to do" or guidance will be great help.
thanksSharma,
While not easy in the best of circumstances, depending on what you have, and what you need to do, there are some possibilities, and one might help.
First, I would attach a screen-cap of the that Video. You might need to post a couple, if things change dramatically in the Frame. No promises, but there might be some options.
However, if you can take Jim's suggestion, and get the footage without the Text, things will be so much easier.
Also, do you have access to Adobe After Effects?
How about Photoshohop Extended, CS 6, or CC?
If it cannot be done in PrPro (fewer Tools to employ), it might be possible in AE, or Ps (through Rotoscoping).
Let us see what you have, and someone will try to help, though remember that the answer might be just as CC_Merchant says, "No."
Good luck,
Hunt -
Help with removing text from background
Hi,
I'm pretty new to this, but I'm trying to figure out how to remove text from a background. My problem is that when I use tools to grab the text, it only selects part of it because the pixels of the text are actually different colors as it blends in with the backgorund. Does anyone have a quick idea how to do this?
Thanks
<link removed>Don't you like to see people's websites/projects/works in forums? Seems to me that you get to know people and what they are into when they post their work. Anyways in the spirit of you helping me, here is the picture.
I'm trying to remove the letters from the background. Everything about the letters including the shadows.
Thanks -
Help! Trying to remove text from an already saved image
I accidently saved an image with my watermark & now the image is locked & also saved as a jpeg image. I can't remove the text without stamping it out or just starting over. Does anyone know how to remove text from an image that has already been saved?
You could have saved it before closing the image. As long as the image is open in Editor, we can always go back to the original position and get back the original file.
In case you have closed, check if you have saved it as a version set. If your file name contains "edited-1" something, you have the file preserved.
Otherwise, if you have replaced the file without having any copy of it anywhere else, you cannot revert the changes. -
How to extract text from a PDF file?
Hello Suners,
i need to know how to extract text from a pdf file?
does anyone know what is the character encoding in pdf file, when i use an input stream to read the file it gives encrypted characters not the original text in the file.
is there any procedures i should do while reading a pdf file,
File f=new File("D:/File.pdf");
FileReader fr=new FileReader(f);
BufferedReader br=new BufferedReader(fr);
String s=br.readLine();any help will be deeply appreciated.jverd wrote:
First, you set i once, and then loop without ever changing it. So your loop body will execute either 0 times or infinitely many times, writing the same byte every time. Actually, maybe it'll execute once and then throw an ArrayIndexOutOfBoundsException. That's basic java looping, and you're going to need a firm grip on that before you try to do anything as advanced as PDF reading. the case.oops you are absolutely right that was a silly mistake to forget that,
Second, what do the docs for getPageContent say? Do they say that it simply gives you the text on the page as if the thing were a simple text doc? I'd be surprised if that's the case.getPageContent return array of bytes so the question will be:
how to get text from this array? i was thinking of :
private void jButton1_actionPerformed(ActionEvent e) {
PdfReader read;
StringBuffer buff=new StringBuffer();
try {
read = new PdfReader("d:/getjobid2727.pdf");
read.getMetaData();
byte[] data=read.getPageContent(1);
int i=0;
while(i>-1){
buff.append(data);
i++;
String str=buff.toString();
FileOutputStream fos = new FileOutputStream("D:/test.txt");
Writer out = new OutputStreamWriter(fos, "UTF8");
out.write(str);
out.close();
read.close();
} catch (Exception f) {
f.printStackTrace();
"D:/test.txt" hasn't been created!! when i ran the program,
is my steps right? -
How to email text from a text component in my applet on a the host server ?
How to email text from a text component in my applet on a the host server, back to my email address ?
Assuming I have Email Form on the host server.
Help will be appreciated.You can do like below
=REPLACE(Fields!Column.Value," " & Parameters!ParameterName.value & " ","<b>" & Parameters!ParameterName.value & "</b>")
The select the expression and right click and choose placeholder properties
Inside that set Markup type as HTML
then it will highlight the passed parameter value in bold within the full xml string
Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs -
How to get Text from (.txt) file to display in the JTextArea ?
How to get Text from (.txt) file to display in the JTextArea ?
is there any code please tell me i am begginer and trying to get data from a text file to display in the JTextArea /... please help...public static void readText() {
try {
File testFile = new File(WorkingDirectory + "ctrlFile.txt");
if (testFile.exists()){
BufferedReader br = new BufferedReader(new FileReader("ctrlFile.txt"));
String s = br.readLine();
while (s != null) {
System.out.println(s);
s = br.readLine();
br.close();
catch (IOException ex){ex.printStackTrace();}
}rykk -
Remove "&" charachter from string
Hi,
Please inform me how can i remove the & from string.
i try this but not working.
SELECT REGEXP_REPLACE(’raise the level of &performance, creativity',’&','') COL1 FROM DUAL;
Also i want to remove any special character from statement.
many thanksAyham wrote:
i try this but not working.
SELECT REGEXP_REPLACE(’raise the level of &performance, creativity',’&','') COL1 FROM DUAL;Are you getting any error?
SQL> set define off
SQL> SELECT REPLACE('raise the level of &performance, creativity','&') COL1
2 FROM DUAL;
COL1
raise the level of performance, creativity>
Also i want to remove any special character from statement.
Search the forum..
Sample:Re: How to find Special Characters in a single query
Edited by: jeneesh on Sep 17, 2012 12:26 PM -
How to print texts from iphone 4
how to print text from iphone 4 without having to screenshot?
An iOS cannot be downgraded or uninstalled...Apple has never supported doing this and removes the older iOS version files when a new iOS is released.
-
Help :how to remove spaces in string
could any body please help me in removing spaces from string suppose i have written vivek chhabra and i want to remove spaces in this string and want a string vivekchhabra then how this could be done
anybody help me please
vivekString string = "Hello - This is a test!";
String result = string.replaceAll(" ", "");
System.out.println(result);This code results the following output:
Hello-Thisisatest! -
How to sent text from my C# WinForm program to another program - where the cursore is
hi
how to sent text from my C# WinForm program to another program - where the cursore is
for example: i have in my program label that contain "ABC" , when i press 'Z'
the ABC will Appears where the cursore is standing.
how to do it ?
what to look for ?
thanksHi E_Gold,
You'll need to:
1) Bring the app to the front
2) SendKeys to the app
This code will send "ABC" to MS Word:
using System.Runtime.InteropServices;
private void Form1_Load(object sender, EventArgs e)
// Send the keys 'ABC' to MS Word:
SendKeysToApp("word", "ABC");
private void SendKeysToApp(string appName, string keys)
if (BringAppToFront(appName))
SendKeys.Send(keys);
[DllImport("User32.dll")]
private static extern void SwitchToThisWindow(IntPtr hWnd, bool fAltTab);
private bool BringAppToFront(string processName)
IntPtr hWnd = HWnd(processName);
if (hWnd != new IntPtr(0))
SwitchToThisWindow(hWnd, true);
return true;
else
return false;
private IntPtr HWnd(string processName)
IntPtr hwnd = new IntPtr(0);
using (Process process = ProcessGet(processName))
if (process != null)
try
IntPtr h = process.MainWindowHandle;
hwnd = h;
catch
if (hwnd != new IntPtr(0))
return hwnd;
return hwnd;
public Process ProcessGet(string processNameToGet)
if (processNameToGet == "")
return null;
Process[] processes = Process.GetProcesses();
foreach (Process process in processes)
if (process.ProcessName.IndexOf(processNameToGet, StringComparison.CurrentCultureIgnoreCase) != -1)
return process;
return null;
For info on sending special keys such as "Enter", so this page on MS website:
SendKeys Class
Hope this helps.
Thanks, Andy -
How to extract text from a PDF file using php?
How to extract text from a PDF file using php?
thanks
fabio> Do you know of any other way this can be done?
There are many ways. But this out of scope of this forum. You can try this forum: http://forum.planetpdf.com/
Maybe you are looking for
-
Problems with Photoshop performance and data transfer speed on iMac
Two months ago, I started noticing slow performances using Photoshop (above all using clone stamp tool) on my 27" iMac (late 2012). I did the AHT and I found that 8GB of 32GB RAM were broken. I removed them but the problem didn't disappered, I also n
-
Hey i have an apple time capsule (not the very latest one, but the one before that) and i am trying to connect my 1.5TB toshiba hard drive to it. i understand that it needs to be powered, so i purchased a usb hub ("usb hub man" by Gadget Geek) and bo
-
Disappeared Acrobat in Access 2007
My computer is running Windows 7 , CS5 (acrobat 9 pro) and Office 2007 suite (Access). I did not have any problem with Access07 until last Friday. Today I found that Acrobat tool bar is gone in Access 2007. So I want not able to convert any Access f
-
Chromium passwords missing ONLY when logging in via lxdm
Crazy I know but it's true. If I log in via lxdm and from with in chromium: preferences>personal stuff>manage saved passwords both "saved passwords" and "never saved" are blank. If I switch /etc/inittab to use lightdm, telinit 3 && telinit 5 and lo
-
IPhoto '11 won't import 3gp files, but iPhoto '09 did. Help!
I had iPhoto '09, which imported 3gp video files from my android phone just fine. Then I upgraded to iPhoto '11, and suddenly I can't import them; they're an "unrecognized file format" WTH? Why, Apple, why? Just to add insult to injury, the old 3gp