How to find out index of string
Hi,
Can you help me to find out index of following strting.
"sss.xxxxx_pain.001.001.02_1002225618.xml"
need to get value "1002225618".
ideally i need to get the value inbetween after second "_" and value before ".xml".
Thanks
Mahi
Hi Mahi,
UDF should be like this:
If you do not want .xml in the out replace statement
var1=var1.substring(sublen+1, len);
with
var1=var1.substring(sublen+1, len-4);
Regards,
Krupa
Similar Messages
-
How to find out if a string is all alphabets
Hi,
How can I find out if a string contains all alphabets? Please help. Thanks.Hi,
How can I find out if a string contains all
all alphabets? Please help. Thanks. I am not sure if there's easier way. But this code should do what you want:
boolean bAlpha = true;
for (int i=0; i<str.length; i++)
if (!Character.isLetter(str.charAt(i))){
bAlpha = false;
break;
//bAlpha is true if str contains only alphabets. -
How to find out index from table?
Hi all,
I've tried to create indexes to some columns from some tables to use for Oracle Text.
I ve got a error message saying that I can not create an index:
"cannot create multiple domain indexes on a column list using same indextype".
I was wondering if an index already exists for that column, how do I find out the name of the index that points to that paticular colum?
Thanks a lot
E.Check the view dba_ind_columns
That will tell you.
something like;
select index_name, column_position, column_name from dba_ind_columns
where table_name = '<table name>'
order by 1,2 -
How to find out Index Rebuild times?
Hi,
We have many indexes but I can't find out when they were rebuilded last. Is it possible to find index last rebuild time?
db version: 9.2.0.8
Regards and thanksQuery for LAST_DDL_TIME in DBA_OBJECTS / USER_OBJECTS for those indexes.
Hemant K Chitale -
How to find out what a string contains?
I'm in the process of writing an XML parser for a project that I am working on. There will be one field in the XML that can be used to store an int, a date, or a string. I need to figure out a way to determine if that field contains an int, a date, or a string without modifying the XML at all. Meaning I can't just put an indicator in the XML itself. So given the string of data from the xml, how do I figure out what it is so that I can convert it to that type?
Any help would be appreciated as I don't have much time left to work on this.How are you going to be able to tell?
There will be one field
in the XML that can be used to store an int, a date,
or a string. "20010101" fits all three. In the absence of any other information, there's no way to tell what the sender meant the type to be.
Now, if you assume some formatting information, then you have a chance. Let's say that "dates" MUST be in the format "YYYY-mm-dd hh:MM:ss". Use SimpleDateFormat and Calendar and try to parse the string. If it works - it's a Date.
If it doesn't work - try to parse it as an Integer. If it works - it's an int.
If THAT doesn't work - give up and just use the String.
Does that help?
Grant -
How to find out whether the String contains chinese characters
I need to check if the string contains chinese characters in Java. Does anyone know how to do it? thx.
Since Java strings contain UNICODE code points, check the content against the relevant page here - http://www.unicode.org/charts/ .
-
How to find out the exact string in a single line?
Hi,
I have some data in table like below.
CERTTEST
CERT TEST
CERT
My requirement is fetch only CERT as a output.
Please share your thoughts.
ThanksNot sure what's the issue:
with t as (
select 'CERTTEST' str from dual union all
select 'CERT TEST' from dual union all
select 'CERT' from dual
-- end of data sample
select str
from t
where str = 'CERT'
STR
CERT
SQL> SY.
P.S. And if you need to seclect case insensitive CERT, use:
SQL> with t as (
2 select 'CERTTEST' str from dual union all
3 select 'CERT TEST' from dual union all
4 select 'CeRt' from dual union all
5 select 'CERT' from dual
6 )
7 -- end of data sample
8 select str
9 from t
10 where upper(str) = 'CERT'
11 /
STR
CeRt
CERT
SQL> -
How to find out if a string has 2 letters
I am making an app in which I am getting information from a date selector and if the selected date is, for example, 1, it needs to be 01, so I need to get a command that can tell if the text has 2 digits.
For example:
if (dateTime.Value.Month.ToString() == TwoDigits)
ToMonth_Text.Text = dateTime.Value.Month.ToString();
else
//Month for To Date
if (dateTime2.Value.Month.ToString() == "1")
ToMonth_Text.Text = "01";
if (dateTime2.Value.Month.ToString() == "2")
ToMonth_Text.Text = "02";
if (dateTime2.Value.Month.ToString() == "3")
ToMonth_Text.Text = "03";
//And so on....
Zack BowlingThanks, this worked for me. Here's my code I used for any future people who have the issue:
private void To_Closed(object sender, EventArgs e)
var dateTime2 = To_Text.Value;
ToMonth_Text.Text = dateTime2.Value.Month.ToString();
ToDay_Text.Text = dateTime2.Value.Day.ToString();
if (ToMonth_Text.Text.Length == 2)
ToMonth_Text.Text = dateTime2.Value.Month.ToString();
else
//Month for To Date
if (dateTime2.Value.Month.ToString() == "1")
ToMonth_Text.Text = "01";
if (dateTime2.Value.Month.ToString() == "2")
ToMonth_Text.Text = "02";
if (dateTime2.Value.Month.ToString() == "3")
ToMonth_Text.Text = "03";
if (ToDay_Text.Text.Length == 2)
ToDay_Text.Text = dateTime2.Value.Day.ToString();
else
//Day for To Date
if (dateTime2.Value.Day.ToString() == "1")
ToDay_Text.Text = "01";
if (dateTime2.Value.Day.ToString() == "2")
ToDay_Text.Text = "02";
if (dateTime2.Value.Day.ToString() == "3")
ToDay_Text.Text = "03";
Zack Bowling -
How to find out if there are repeated characters in a string
hey guys
well i kinda have a little problem figuring out how to find out
if there are repeated characters in a string.
if anyone can help, would appreciate it.
thanks
milosTry using the StringTokenizer class. if u already know which character to trace. this could do the job.
eg. String str = "here and there its everywhere";
StringTokenizer st = new StringTokenizer(str, "e");
int rep = st.countTokens(); -
How to find out how many space character in setence (string var) ?
Dear all Master,
I need Your help please.
Topic:
Script Editor.
My System:
-CUCM 7.0
-UCCX 7.0 premium
-Nuance recognizer 9.0
Question:
ABC = string var.
ABC = "this is sample"
2 space character in ABC string var.
How to find out how many space character in ABC var ?
Regards,
SusantoHi
Create a int variable called whatever you want, then insert a SET step.
Set the variable to the new int you created, and then paste this into the 'value' field:
String[] myarray = teststring.split(" ");
return myarray.length -1 ;
Basically it splits the string into chunks each time it hits the " " character.
This results in an array of the resulting chunks (i.e. words), which is one more than the number of spaces. -1 from that, and you have your int variable set to the number of spaces.
Regards
Aaron
Please rate helpful posts... -
How to find out which type of the driver is used in our application?
Hi all,
can anyone tell me how to find out which type of the driver is used in our application?
Thanks in advance,
PhoenioxHi,
Check out this...
Class.forName("com.mysql.jdbc.Driver"); //if u r using MySql
List drivers = Collections.list(DriverManager.getDrivers());
for(int i=0;i<drivers.size();i++)
Driver driver = (Driver)drivers.get(i);
String driverName = driver.getClass().getName();
System.out.println("Driver "+i+":::"+driverName);
you need to load the driver and display in the same program.
Then only you'l get the required result.
prakhyath -
How to find out which job is calling package
Respected sir,
How to find out which job is calling my package. Please help me regarding this.
Regards,
user570124Please read about [url http://download-uk.oracle.com/docs/cd/B19306_01/appdev.102/b14258/d_util.htm#i997163]DBMS_UTILITY.FORMAT_CALL_STACK in the manual.
or [url http://asktom.oracle.com/tkyte/who_called_me/index.html]this routine from Tom Kyte may be what you are looking for.
Regards,
Rob. -
How to find out when data was deleted from table in oracle and Who deleted that
HI Experts,
Help me for below query:
how to find out when data was deleted from table in oracle and Who deleted that ?
I did that to fidn out some data from dba_tab_modifications, but I m not sure that what timestamp shows, wether it shows for update,insert or delete time ?
SQL> select TABLE_OWNER,TABLE_NAME,INSERTS,UPDATES,DELETES,TIMESTAMP,DROP_SEGMENTS,TRUNCATED from dba_tab_modifications where TABLE_NAME='F9001';
TABLE_OWNER TABLE_NAME INSERTS UPDATES DELETES TIMESTAMP DROP_SEGMENTS TRU
PRODCTL F9001 1683 46 2171 11-12-13 18:23:39 0 NO
Audit is enable in my enviroment?
customer is facing the issue and data missing in the table and I told him that yes there is a delete at 11-12-13 18:23:39 in table after seeing the DELETS column and timestamp in dba_tab_modifications, but not sure I am right or not
SQL> show parameter audit
NAME TYPE VALUE
audit_file_dest string /oracle/admin/pbowe/adump
audit_sys_operations boolean TRUE
audit_syslog_level string
audit_trail string DB, EXTENDED
please help
Thanks
SamLOGMiner --> Using LogMiner to Analyze Redo Log Files
AUDIT --> Configuring and Administering Auditing -
How to find out structure of internal table?
Hi
is there any way how to find out name of structure upon which internal
table was created?
i got internal table passed to function module by any table
type. There can be different types of table passed in. Inside of
module a need to find out the structure of table.
I've found a tricky way how to find this information using following
command 'DESCRIBE FIELD dobj INTO td.', but its probably not a correct
way because using this command is not recommended in application
programs.
Is there any function module, or something i can use for getting this information?
ThanksThanks very much
This has solved my problem:
DATA descr_ref TYPE ref to cl_abap_typedescr.
DATA tabname TYPE string.
descr_ref = cl_abap_typedescr=>describe_by_data( itab ).
tabname = descr_ref->absolute_name. -
How to find out which objects are at the end of the datafiles
My Scenario is having a tablespace of 65G but the data is 5G and that is at the end of datafile for that we are not able to resize the datafile our though is to find out what are the objects at that end of datafiles and will either alter move <owner.tablename> move or alter index <owner.index> rebuld online.
For that how to find out which objects are at the end of the datafiles.>
My Scenario is having a tablespace of 65G but the data is 5G and that is at the end of datafile for that we are not able to resize the datafile our though is to find out what are the objects at that end of datafiles and will either alter move <owner.tablename> move or alter index <owner.index> rebuld online.
For that how to find out which objects are at the end of the datafiles.
>
You may want to copy this and add it to your toolkit
See 'What's at the End of the File?' in this Tom Kyte article from the Sept 2004 Oracle Magazine
http://www.oracle.com/technetwork/issue-archive/o54asktom-086284.html
And this AskTom blog shows you how to generate a script containing ALTER statements toresize your datafiles to the smallest possible. You can 'pick and choose' from the ALTER statements to do what you want.
Then of course, you can use techniques from this article by Oracle ACE, and noted author, Jonathan Lewis
http://jonathanlewis.wordpress.com/2010/02/06/shrink-tablespace/
Maybe you are looking for
-
Item '(item name)' could not be moved message
I get the message "The item '(item name)' could not be moved because '(folder)' cannot be modified." when trying to copy files from my iBook to my iMac over the network. This includes Home, Desktop, and other folders. The odd thing is this has worked
-
Hello all! I just became the owner of an audigy 4 pro and everything seems to be working fine except for the hardware ac3 and dts decoding. Both windows media player 0 and powerdvd 5 behave as if the dvd is scratched (glitchy playback) when i turn on
-
Control Panel on an 800x600 screen
I have to do some InDesign CS6 demos using a projector. The projector can only handle 800x600 resolution. The biggest challenge here is to demo the control panel in its eternity and I don't want to customise the panel every 5 seconds to display anoth
-
Problem with large inlined images
One of the annoying aspects when inlining images is the fact that it seems to be possible to blow the margins by any amount with no limit. Once a thread contain an image a few thousand pixels wide, all posts in the thread will wrap the text at a widt
-
"movie must be rendered before it can be encoded"
Hey all... I'm trying to export to mpeg2 or otherwise to Quicktime so I can burn a dvd. Now with the first I get the message that "this movie must be rendered before it can be encoded" in QT conversion with mpeg2 selected. There are no red lines indi