Extract string
I am editing a pld.I have address as,
Sam Steel Corporation,
Plot No.A-52,Patil Lane,
Satpur,Nashik-7
This address is saved as string in the database as,
Sam Steel Corporation,Plot No.A-52,Patil Lane,Satpur,Nashik-7
I want to extract name Sam Steel Corporation as a variable and Plot No.A-52,Patil Lane,Satpur,Nashik-7 as another variable.
Hi Dilip,
Try this,
1st Case:
->> Open the PLD and Create Database Fields and put the Company Name & Address.
1st DB Field -> Company Name
Table Name -> OADM - Administration.
Column -> PrintHeadr - Printing Header.
2nd DB Field -> Building
Table Name -> ADM1 - Administration Extension.
Column -> Building - Building/Floor/Room.
3rd DB Field -> Street
Table Name -> ADM1 - Administration Extension.
Column -> Street.
4th DB Field -> City.
Table Name -> ADM1 - Administration Extension.
Column -> City.
5th DB Field -> Zipcode.
Table Name -> ADM1 - Administration Extension.
Column -> ZipCode.
6st DB Field -> Country.(and Check the Get Discription on Properties Area Window)
Table Name -> ADM1 - Administration Extension.
Column -> Country.
2nd Case:
Hide the 6 Company Name & Addres Database Field and Create 1 Formula Field then Use to Concat Format.
Formula 1: Concat(Building,',',Street,',')
Formula 2: Concat(City,'-',ZipCode,',')
Else,
HardCode the Company Name and Address
The Best Way of you can Create 2 Text Field in PLD and HardCode the Company Name and Address.
1. Text Field -> Company Name and Set Font Bold.
2. Text Field -> Company Address
Regards,
Madhan.
Edited by: Madhan Babu C on Aug 11, 2009 2:26 PM
Similar Messages
-
Extracting strings from binary data
Hello,
I am trying to extract string from a binary file.
At the unix command line (sunos) I can just type;
strings <filename>
This is a nice way to get a list of the contents of a directory.
Is there a way in pl/sql to extract strings from binary data ? An equiv to strings on unix/linux ?
Thanks in advance.
BenHi,
If you do want to list the contents of a directory, there are other ways to do it. Here's a base implementation of a utility I wrote:
create or replace and resolve java source named "Util" as
import java.io.*;
import java.sql.*;
import oracle.sql.*;
import oracle.jdbc.driver.*;
public class Util {
public static void listFiles(String directory, oracle.sql.ARRAY[] names)
throws IOException, SQLException {
File f = new File(directory);
if(f==null)
throw new IOException("Directory: "+directory+" does not exist.");
String[] files = f.list(
new FilenameFilter() {
public boolean accept(File dir, String name) {
// List all files
return true;
Connection conn = new OracleDriver().defaultConnection();
ArrayDescriptor descriptor = ArrayDescriptor.createDescriptor("VC_TAB_TYPE", conn);
names[0] = new ARRAY(descriptor, conn, files);
return;
create or replace type vc_tab_type is table of varchar2(255);
create or replace package util authid current_user as
function list_files(p_directory in varchar2)
return vc_tab_type;
end;
create or replace package body util as
procedure list_files (
p_directory in varchar2
, p_filenames out nocopy vc_tab_type
is
language java
name 'Util.listFiles(java.lang.String, oracle.sql.ARRAY[])';
function list_files(p_directory in varchar2) return vc_tab_type
is
l_filenames vc_tab_type := vc_tab_type();
begin
list_files(p_directory, l_filenames);
return l_filenames;
end;
end;
/You can then query the filesystem as follows:
1 select column_value as filename
2 from table(util.list_files('c:\windows'))
3 where column_value like '%.log'
4* and rownum <= 10
SQL> /
FILENAME
0.log
AdfsOcm.log
aspnetocm.log
bkupinst.log
certocm.log
chipset.log
cmsetacl.log
comsetup.log
DtcInstall.log
FaxSetup.log
10 rows selected.cheers,
Anthony -
How to extract string with delimiter
Hello all,
I'm using Oracle 10g and want to extract string with a delimiter.
For example, i have aaaa;;bbbb;cccc;dddd;eeee;ffff and i want to extract this string into separates strings 'aaaa', ' ', 'bbbb', 'cccc', 'dddd', 'eeee', 'ffff'.
Thanks a lots for yours help.
MK.I prefer the regular expression method myself...
SQL> ed
Wrote file afiedt.buf
1 with t as (select 'aaaa;;bbbb;cccc;dddd;eeee;ffff' as txt from dual)
2 -- end of sample data
3 select REGEXP_SUBSTR (txt, '[^;]+', 1, level)
4 from t
5* connect by level <= (select length(regexp_replace(txt,'[^;]*'))+1 from t)
SQL> /
REGEXP_SUBSTR(TXT,'[^;]+',1,LE
aaaa
bbbb
cccc
dddd
eeee
ffff
7 rows selected.
SQL> -
Tools for extracting strings from java code for internationalization
For legacy code with lots and lots of strings what method is typically used to extract strings for internationalization?
Am I right in thinking you couldnt simply grep for strings, it could get pretty complitcated, especially with escape characters, escaped quotes etc.,
-SKWhen dealing with legacy code, it is nice to have an application that queries you as it extracts the strings. You have a choice whether to accept the string as a localizable entity or not.
There are several tools that do this...including some IDEs like JBuilder. Although it isn't a fully supported or robust tool, Sun has a utility for extracting strings in Java source files:
http://java.sun.com/products/jilkit/.
Regards,
John O'Conner -
Extracting string from a file name
Hello,
I have a legacy (read: I didn't build it) SharePoint list that includes some validation when uploading files that's giving me some trouble.
Basically, our users are required to add files to a list in a certain filename format and based on the naming convention are approved/rejected and routed to the appropriate location.
One of the validations looks at a section of the file name and compares it to a folder name in the library.
For example, the file name format is XX_AAA_999_2014_05.xlsx and that matches on the folder name of /submissions/2014_05
Currently the rule says look at the last 7 characters of the folder and the 7 characters starting at position 12 of the filename and make sure they match.
The problem is the 999 in the example above is a sequential identifier to the project a file is associated with... e.g. they range from project 000 to project 999. We've now hit project 1000 so file being added for project 1000 (and beyond) fails because
the starting position has shifted one spot. (Note: we have active 3 digit projects so I cannot simply change that to be position 13... not to mention what that does to my history).
So, my task is to come up with something that can accomodate 3 or 4 digit numbers.
I'm trying to stick as closely to the original setup so I don't mess up the history so I'm looking at other methods of getting to the same data in the string. Another problem is that the file names include the extension and the extension can be 3 (pdf)
or 4 (xlsx) characters long.
I've tried this: =LEFT([Source File Name],SEARCH(".",[Source File Name])-1)
but that brings back everything in front of the period and I need just the 7 preceeding characters. Is there a way to limit the number of chars a LEFT() function returns?
In a nutshell, the 4 variations of file names are as follows of which I need to extract the
bolded section.:
ZZ_AAA_999_2014_05.xls
ZZ_AAA_999_2014_05.xlsx
ZZ_AAA_1000_2014_05.xls
ZZ_AAA_1000_2014_05.xlsx
Thanks!
KevinHi,
According to your description, you might want to retrieve the string “2014_05” from the file name.
I would suggest you create a SharePoint Designer workflow and implement your logic of handling the filename.
In SharePoint Designer 2010, there are already some useful utility workflow actions which can enable users to deal with the various requirements come from the business scenarios.
For the string handling, you can consider to use the
Utility Actions:
http://msdn.microsoft.com/en-us/library/office/jj164026(v=office.15).aspx
Another two links about creating SharePoint Designer workflow for your reference:
http://office.microsoft.com/en-001/sharepoint-designer-help/introduction-to-designing-and-customizing-workflows-HA101859249.aspx
http://www.codeproject.com/Tips/415107/Create-a-Workflow-using-SharePoint-Designer
Thanks
Patrick Liang
Forum Support
Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
[email protected]
Patrick Liang
TechNet Community Support -
Hello,
I need to extract the value of the strings for REQUEST_GROUP_CODE and REQUEST_GROUP_APPL_SHORT_NAME. As you can see I have to deal with whitespace differences, case differences etc. I need the values between the quotes for each one. I would expect to get ACCOUNTING and AR for the first example. I am using db version 11g r1.
Thanks.
WITH TEST AS
(SELECT 'REQUEST_GROUP_CODE="ACCOUNTING" REQUEST_GROUP_APPL_SHORT_NAME="AR" TITLE="AR:AR_SRS_TITLE_ACC_RPTS"' str FROM dual
UNION ALL
SELECT 'REQUEST_GROUP_CODE = "PRINT_CONSINV"REQUEST_GROUP_APPL_SHORT_NAME = "AR"TITLE = "AR:AR_CONS_INV_WINDOW_TITLE"' FROM DUAL
UNION ALL
SELECT 'REQUEST_GROUP_CODE="JL_CO_MG_REQUEST_GROUP" REQUEST_GROUP_APPL_SHORT_NAME="JL" TITLE="JL:JL_CO_GL_MG_WINDOW_TITLE"' FROM DUAL
UNION ALL
SELECT 'Request_Group_Code="OE_CONC_PROGRAMS" Request_Group_Appl_Short_Name="OE" Title="OE:OE_SRS_TITLE_CONC_PROGRAMS"' FROM DUAL
UNION ALL
SELECT 'TITLE="INV:INV_INVENTORY_COSTS_REPORTS" USE_ORG="Y" REQUEST_GROUP_APPL_SHORT_NAME="INV" REQUEST_GROUP_CODE="INV_COST_REPORTS_GUI" PROGRAM_APPL_SHORT_NAME="BOM"' FROM DUAL
SELECT str
FROM TESTEdited by: Vortex13 on Jun 20, 2012 9:12 AMSQL> WITH test AS
2 (SELECT 'REQUEST_GROUP_CODE="ACCOUNTING" REQUEST_GROUP_APPL_SHORT_NAME="AR" TITLE="AR:AR_SRS_TITLE_ACC_RPTS"' str FROM dual
3 UNION ALL
4 SELECT 'REQUEST_GROUP_CODE = "PRINT_CONSINV"REQUEST_GROUP_APPL_SHORT_NAME = "AR"TITLE = "AR:AR_CONS_INV_WINDOW_TITLE"' FROM DUAL
5 UNION ALL
6 SELECT 'REQUEST_GROUP_CODE="JL_CO_MG_REQUEST_GROUP" REQUEST_GROUP_APPL_SHORT_NAME="JL" TITLE="JL:JL_CO_GL_MG_WINDOW_TITLE"' FROM DUAL
7 UNION ALL
8 SELECT 'Request_Group_Code="OE_CONC_PROGRAMS" Request_Group_Appl_Short_Name="OE" Title="OE:OE_SRS_TITLE_CONC_PROGRAMS"' FROM DUAL
9 )
10 SELECT regexp_substr(str, 'REQUEST_GROUP_CODE\s*=\s*"(.*?)"', 1, 1, 'i', 1) as REQUEST_GROUP_CODE
11 , regexp_substr(str, 'REQUEST_GROUP_APPL_SHORT_NAME\s*=\s*"(.*?)"', 1, 1, 'i', 1) as REQUEST_GROUP_APPL_SHORT_NAME
12 FROM test
13 ;
REQUEST_GROUP_CODE REQUEST_GROUP_APPL_SHORT_NAME
ACCOUNTING AR
PRINT_CONSINV AR
JL_CO_MG_REQUEST_GROUP JL
OE_CONC_PROGRAMS OE -
Scan from string and extract string between delimiter
Hello,
Basic questions. Is it possible with the scan from string regular expression to extract the string that are within the specified delimiters. Here is an example:
\\Name of folder 1\Name of folder 2\Name of folder 3\File Name
Can the scan from string output the following by specifying the right regular expression:
Name of folder 1
Name of folder 2
Name of folder 3
File Name
I have tried \\\\%s\\%s\\%s\\%s but the %s stops at the first white space.
Thanks,
Michel
Solved!
Go to Solution.RavensFan suggested the appropriate function for your requirement, however you can also use an alternative, which is 'Spreadsheet String To Array'.
I am not allergic to Kudos, in fact I love Kudos.
Make your LabVIEW experience more CONVENIENT. -
Extracting string from CLOB data
All, I have a table that has two columns, ID and CLOB_DATA. For the CLOB_DATA, the data is simply a long string of text with pipes at certain intervals as follows:
CLOB_DATA
1423292Myname is so and so etc wyouhsma||QA29-9878|3/7/89|6798.78|||ETCCCC.......||
The above would be one record in the table. As an example, I need to extract the string QA29-9878 from this data. All I know is that this particular string will always be between the second and third pipe. I realize this maybe require just a simple query using the substr and instr functions but I can quite construct it so any help would be appreciated.
Thanks.SQL> WITH t AS
2 (SELECT '1423292Myname is so and so etc wyouhsma||QA29-9878|3/7/89|6798.78|||' str
3 FROM dual)
4 SELECT ltrim(regexp_substr(str,'(^|\|)[^|]*',1,3),'|') sub_str FROM t
5 /
SUB_STR
QA29-9878 -
I require anyones help to extract string from an html tag
I wanted to extract the strings available in the tag named html
eg.. <html> Hello </html>
I require to extract the string Hello into a string variable without using if's
Secondly,
i require to extract the name of form in the html tag ..
eg.. <form name= 'basic'> </form>
Can any one tell how can this be implemented efficiently.. and using wich concept can this be implemented easily..
Thanking you,
bye..
ur's True friendUse a ParserCallback. It notifies you everytime it finds a new tag:
http://forum.java.sun.com/thread.jspa?forumID=31&threadID=623365
Or use the HTMLEditorKit to parse the HTML. Then use an iterator to get the tag you need. See reply 5:
http://forum.java.sun.com/thread.jspa?forumID=31&threadID=655038 -
Extract string between two parts
Hi all,
I am trying to extract a string using the regexp substr with no luck:
string is :
ws-servername.domain name
example:
ws-db1.mydomain
desired outcome :
servername only
any ideas ?
Thanks
YoavSELECT Regexp_Substr('ws-servername.domain name',
'[^\.^\-]+',
1,
Rn + 1)
FROM (SELECT Regexp_Count('ws-servername.domain name',
'[-]+') Rn
FROM Dual)Edited by: Sen on Dec 6, 2011 5:14 AM -
Extract String after Last "/"
Hi Gurus:
I have document path recorded from log files, which I need to feed to Lumira for Data Analysis.
What we want is just the document name and not the entire path. I was able to extract/extrapolate that in excel as "=RIGHT(A1,LEN(A1)-(FIND("@",SUBSTITUTE(A1,"/","@",(LEN(A1)-LEN(SUBSTITUTE(A1,"/","")))/LEN("/")))))".
Wonder if this is even possible in Lumira Dimensions? Extract the Strings after the last "/".
Regards,
Varun BiswasUsing SUBSTR
with data as
select '[email protected]' col from dual
select substr(col, instr(col, '@', 1, 1) + 1) domain
from data;Using Regular Expressions
with data as
select '[email protected]' col from dual
select trim('@' from regexp_substr(col, '@.*', 1)) domain
from data;Regards,
P. -
Extracting string inside double quote
Hi,
In perl this is really easy, but I can't get it to work correclt in java. I'm trying to extract a string that is in double quotes following a keyword...
String: SRCH base="o=answer" filter="me" attrs=ALL
I want to extract the first quoted value after "SRCH base="
In perl I used: / SRCH base=\"(.*)\" /i
In java I'm using: " SRCH base=\"(.*)\" "
The problem is that it doesn't stop after hitting the second quote. So I get this result:
o=answer" filter="me
Notice that it stopped matching after hitting the third quote. Weird.
I know this is probably really simple, but I'm stumped.
Thanks,
MarkI guess if you wrote a regex that matches any string
that starts with ", ends with ", and has anything in
between you could use a Matcher to find each
occurrence, but I don't regex enough to write it :)[url #" style="display: block; background-image: url('http://www.shanghaiist.com/attachments/shang_neil/bat-signal-edit.jpg'); width: 325px; height: 217px] -
Error in extracting String value from MS ACCESS via JDBC
Something wierd occurs in my program. I have a ACCESS database table named FormDetail. The attributes are:
name memo
val memo
The actual data store in such a table is
haihe 2
String test="SELECT name, val FROM FormDetail";
rs = stmt.executeQuery(test);
while(rs.next())
{ String name = rs.getString("name");
String value = rs.getString("val");
System.out.println("name: "+name+" value: "+value);
When I execute the code, the output is
name: haihe value:
NO VALUE print out. Why?
Any suggestion will be helpful! Thanks!Though not using Access myself in the moment, I remember a lot of post about its memo fields.
Recommend to search for "+access +memo" here. -
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; -
Trying to extract String using pattern
I need to get exact link to image (src value) and alternate text (alt).
HTML, where this image is situated can be:
<IMG class=simple_img height=124 alt="*FirstName LastName MiddleName*" hspace=0 src="/images/7c/6c/d782a19f2f156713a2647dee1fe2.*jpeg*" width=100 align="left" border=0>
or
<IMG class="*simple_img*" height=124 alt="*FirstName LastName MiddleName*" hspace=0 src="/images/7c/6c/d782a19f2f156713a2647dee1fe2.*gif*" width=100 align="left" border=0>
or
<IMG class="*simple_img*" height=124 alt="" hspace=0 src="/images/7c/6c/d782a19f2f156713a2647dee1fe2.*jpeg*" width=100 align="left" border=0>
or
<IMG class=*simple_img* height=124 alt="" hspace=0 src="/images/7c/6c/d782a19f2f156713a2647dee1fe2.gif" width=100 align="left" border=0>
1.My image has class="simple_img", but it can be in "" or without them. Only my image can have such class.
2.It can be gif or jpeg
3.Sometimes alt is empty.
It's great if alt exists, but if it is not, anyway, I need src.
I've wrote regular experession:
private static final String personImagePattern ="\"*simple_img\"*.*alt=\"(.*)\".*src=\"(/images/.*\\.gif|\\.jpeg)\"";The problem is, that my regular expression doesn't match
1. jpeg images
or
2. images with class="simple_img" (" quotes are used ")
3. empty alt="" attribute
4. Mixture of cases 1,2,3
Please, tell me, what's wrong with my regexp?
I've wrote *\"** it means that " can appear or not before and after simple_img
I've wrote \\.gif|\\.jpeg)\" it means .gif or .jpeg can appear.
Here are sample, which haven't matched:
{code}
<IMG class=simple_img height=150 alt="" hspace=2 src="/images/58/19/ee4d0bc5818061771cad1b89308d.gif" width=100 align="left" border=0>
<IMG class=simple_img height=180 alt="FirstName LastName MiddleName" hspace=2 src="/images/29/89/c69a344707cbab3d6c0c06271b25.jpeg" width=140 align="left" border=0>
<IMG class=simple_img height=132 alt="" hspace=5 src="/images/00/0e/5dd91f68c7302880c3a506b263ed.jpeg" width=100 align="left" border=0>
{code}
Please, help.
Edited by: Holod on 11.09.2008 7:20I've modified my regexp:
private static final String personImagePattern ="simple_img.*alt=\"(.*)\".*src=\"(/images/.*\\..+)\".*width";No it captures everything I need, exept case, when alt="", I mena when alt attribute is empty.
I've wrote lt=\"(.*)\". .* tells that something or nothing could be inside quotes of alt attribute.
What Am I doing wrong?
Maybe you are looking for
-
I have a large file (3500x8300px) that i have been working on in Photoshop CS4 and i tried to save it after working on it for about 30 minutes and got the following message: "Could not save as 'filename' because of a program error." I tried saving i
-
I am new to development and started on VB where they had a GUI that was easy for me to learn. I was worried when I switched to JAVA, although I enjoy it I was worried about the GUI, until I found Studio Creator. Can you use Studio Creator for program
-
XML Export/Import Query & Variables
Hello, We are currently bringing up a new environment/landscape. With that, I'm trying to copy some of the query elements off our current production server and move them back to the new development server. After much wasted time trying to duplicate
-
last night I slept with my Lumia 720battery life remaining upto 52 percent .when next morning I woke up ifound that only 5% battery is remaning.how is that possible.i am in big worry,what has happento my Lumia 720 . please help
-
Mass Deletion of Parked Document
Hi, Can someone please let me know how to delete parked documents in MASS, using FBV0, we can delete one by one. If not mass deletion, is there any other option of mass archiving or not releasing kind of stuff? Thanks Balla