Replace exact string from a list seperated by ":" delimeiter
Hi,
How can I replace PROJ1 with PROJ4 and cover all the following options, when items are seperated by ":" delimiter.
1) PROJECT_NAME=PROJ1
2) PROJECT_NAME=PROJ1:PROJ2
3) PROJECT_NAME=PROJ2:PROJ1
4) PROJECT_NAME=PROJ1:PROJ11
5) PROJECT_NAME=PROJ3:PROJ1:PROJ2
in case #4 i want to save PROJ11 and to replace only PROJ1
Thanks,
Sheli
Hi, Etbin,
Sorry, I can't figure out what you're asking.
Etbin wrote:
Not wanting to write regular expressions without database checkingAre you asking if this can be done without regular expressions? Yes, but it's not pretty. It would involve several layers of nested REPLACE (and/or other string manipulation) functions, even without worrying about multiple consecutive occurrences of the target string.
I wonder whether in replacing PROJ1 with PROJ4 we could request to replace PROJ1 only as a complete word ?The solutions above already replace 'PROJ1' only when it is a complete word, not when it is a sub-string of a larger word such as 'PROJ11' or 'SUBPROJ1'.
In this problem, I'm thinking of a "word" as being something delimited by '=', ':' or end-of-string. Does your question involve some different meaning of "word"?
PROJ11 seems to represent the only threat to obtain the wrong PROJ41'PROJ11' is the only example in the given sample data, where the word starts with the target, but then continues. Both solutions above would also handle cases where a word ends with the target, but has something extra first (such as 'SUBPROJ1') or where there are extra characters both before and after the target (e.g. 'SUBPROJ11').
or I'm (lately much too often) missing somethingI'm definitely missing something: a clear idea of what your question is.
Maybe you're just trying to get me to use my funny name for this problem" "I found love in Slovenia". If so, thank you. I'm always happy to have such an oppoortunity.
Similar Messages
-
MySql database query (exact match from a list)
I've got a list of keywords entered into a database field
called
'tour_keywords' like:
europe, austria, lakes, mountains, tyrol, alpine etc
What I want is for results to be return IF ONLY an exact
match is found
in the database. The way I have it at the moment (see mySql
query below)
I only need to type 'tain' or 'kes' and I get results for
'moun'tain's'
OR 'la'kes'' :(
Can I stop this and match only the keywords as specified in
the database
field.
This is the DB query I have:
$query_rsResultsList = sprintf("SELECT * FROM tours WHERE
tour_keywords
LIKE '%%%s%%' ", $colname_rsResultsList);
Thanks
Os.Michael Fesser wrote:
> .oO(Osgood)
>
>
>>I've got a list of keywords entered into a database
field called
>>'tour_keywords' like:
>>
>>europe, austria, lakes, mountains, tyrol, alpine etc
>
>
> Uh ...
>>What I want is for results to be return IF ONLY an
exact match is found
>>in the database. The way I have it at the moment (see
mySql query below)
>>I only need to type 'tain' or 'kes' and I get results
for 'moun'tain's'
>>OR 'la'kes'' :(
>
>
> What about a different table design?
Yeah nice thought. I only have a little to no knowledge of
working with
one table, let alone two or three.
Your current approach is not only
> bad in terms of normalization, it's also very
inefficient, since the DB
> can't use any indexes when performing a search. Full
table scans are
> expensive.
Humm why can't mySql just search a field containing multiple
words for a
particular matching word with a simple query.....maybe that's
what's
inefficient. Granted, I'm totally inefficient as well
(unfortunately I
was born that way) but two inefficients dont make an
efficient ;)
> Since this is a typical m:n relation (many to many), I
would use three
> tables: one for the main tour data, one for the keywords
and a third one
> to connect these:
>
> tours
> -----
> tourId INT UNSIGNED
> ...
> PRIMARY KEY (tourId)
>
> keywords
> --------
> keywordId INT UNSIGNED
> keyword CHAR(20)
> PRINARY KEY (keywordId)
>
> tourKeywords
> ------------
> tourId INT UNSIGNED (FOREIGN KEY on tours.tourId)
> keywordId INT UNSIGNED (FOREIGN KEY on
keywords.keywordId)
> PRIMARY KEY (tourId, keywordId)
>
> This makes it very easy to insert new keywords and to
assign as many
> keywords as necessary to a particular tour. In addition
searching for
> all tours matching one or even multiple(!) keywords is
very efficient.
> Try that with your current design.
Here's wishing lol.
>>Can I stop this and match only the keywords as
specified in the database
>>field.
>>
>>This is the DB query I have:
>>
>>$query_rsResultsList = sprintf("SELECT * FROM tours
WHERE tour_keywords
>>LIKE '%%%s%%' ", $colname_rsResultsList);
>
>
> In the example above the search query would look like
>
> SELECT ...
> FROM tours t
> INNER JOIN tourKeywords USING(tourId)
> INNER JOIN keywords USING(keywordId)
> WHERE keyword = 'mountains'
>
> or for multiple keywords:
>
> ...
> WHERE keyword IN ('mountains', 'lakes')
> GROUP BY t.tourId
Damn.... stop messing with my head.
I'm sure youre 100% correct but I'm a long way off the pace
when it
comes to database structure. -
I'm outputting text content to my page by querying our
database using a simple method, which works fine.
quote:
<cfoutput query="getPageContent" startrow="#vPageContent#"
maxrows="1">#vContent#</cfoutput>
I need to replace certain words to make them bold, for
example...
quote:
<cfset request.vContent = replace(request.vContent,
"phrase", "<B>phrase</B>, "ALL")>
This works, but there is a slight issue, because it will also
replace occurances of the word 'phrase' even if it is within
another word...
for example, co
phrasetastic
So i need to replace only the exact phrase when used on it's
own.
My problem appears quite simple, but I have not found a way
to do this...?quote:
Originally posted by:
Newsgroup User
Sam_Ham wrote:
> <cfset request.vContent = replace(request.vContent,
"phrase", "
phrase,
> "ALL")>
note the spaces in the following:
<cfset request.vContent=replace(request.vContent," phrase
phrase
","ALL")>
or use regex via the reReplace method with something like the
"transition
boundary" escape sequence "\b" (check the syntax, doing this
from poor memory):
reReplace(vContent,"\bphrase\b","
phrase","ALL")
Thanks Paul... it works like a charm! -
How to get key name from parameter list
hi..
i want string from parameter list.. i hv already created parameter list like
ADD_PARAMETER (param_list_id, 'EMPID', TEXT_PARAMETER,'123');
ADD_PARAMETER (param_list_id, 'EMPNM', TEXT_PARAMETER, 'ABC');
ADD_PARAMETER (param_list_id, 'EMPADD', TEXT_PARAMETER, 'XXX');
i got value like '123' ,'ABC', 'XXX' using
eg. get_parameter_attr(param_list_id,'EMPID',aprmlist,avalue)
but i want key name like 'EMPID' , 'EMPNM', 'EMPADD' from param_list_id
is it possible to get this key name from parameter list ???
Thanks...I cannot think of a way to do that. The code that reads the list is supposed to know the key names. That is sort of the point with parameter lists. If you need to have parameter lists that can be interepreted by some code that doesn't know about a specific list but knows how to interpret it by inspecting the key names, perhaps you can specify a separate parameter list with the key names as values and call the keys of that list something generic?
-
Find and Replace text string in HTML
Opps... I hope this forum is not just for Outlook. My Html files reside on my hard-drive. I am looking for VBA code to open specified file names ####File.html and then find and replace text strings within the html for example "####Name" replaced
with "YYYYY"
I drive the "####File.html" names and the find and replace text strings from an Excel sheet. I am an artist and this Sub would give me time to paint instead of find and replace text. Thank you!
[email protected]Hello Phil,
The current forum is for developers and Outlook related programming questions. That's why I'd suggest hiring anybody for developing the code for you. You may find freelancers, for example. Try googling for any freelance-related web sites and asking such
questions there.
If you decide to develop an Outlook macro on your own, the
Getting Started with VBA in Outlook 2010 article is a good place to start from. -
Search for a String in a list of files
Could anyone please send me a java sample code which searches for a string from a list of files and returns me the filename and the line in which the Search String was found ?
Thanks in advance
RRSimple solution would be -
1. Traverse a directory for each file.
2. Read each file using Buffered Reader.
3. Use readLine() method to read a line.
4. Use String.indexOf to see if the data which you are looking for is there in the line or not.
5. If its there then store the line number and file name.
6. When the loop will end you will have list of file name and line number where the data which you are looking for is present. -
hi,
I was trying to get 2 replaced from the list i've from
database.
<cfquery name="test" datasource="test">
SELECT *
FROM test_new.backyard
WHERE weID = 2 OR meID = 2
</cfquery>
#ValueList(test.weID,",")# <br>
#ValueList(test.meID,",")#<br>
<cfset value1 = #ValueList(test.myID,",")#>
<cfset value2 = #ValueList(test.profileID,",")#>
<cfset valueCombined = value1 & "," & value2>
<cfset replacedList =
#ReplaceList(valueCombined,"2","")#>
Replaced: #ReplaceList(valueCombined,"2","")#
<br>
ListChange: #ListChangeDelims(replacedList,"",",")#
At last, i end up having plain numbers 34556376 without any
delimeters. But, i would like to have comma seperated list for
further useage of numbers. I'm not sure which function to use to
add comma's after every number.
Thanks for any help!
Note: I've got my user name changed, my previous screen name
was Syed.try using ListDeleteAt. Use the code below
<cfset posInList = listfind(valueCombined,"2")>
<cfif posInList GT 0>
<cfset replacedList =
#ListDeleteAt(valueCombined,posInList)#>
<cfelse>
<cfset replacedList = valueCombined>
</cfif> -
Getting multiple values from a list box
Hi,
I am not able to get multiple selected values from a list box using the getParameterValues(). I used the following code..
String[] names=request.getParameterValues("lname");
can anyone tell me what the error is or is there any other way i can get multiple selected values from a list box.
Thanks
SatishFragment 1
This is the JSP Code am using for testing
<%
String[] name =request.getParameterValues("D1");
if(name.length==1)
String value=name[0];
Instead of name.lenght==1 try with name!=null
Fragment 2
out.println(value);
replace the above fragment with
%>
<%-- print result -->
<%=name[0]%>
<%
Fragment 3
else
%>
The list box D1 is a multiple select list box.
If it still doesn't work, check that the checkboxes have the same name as well as different values
<input type="checkbox" name="D1" value="1">
<input type="checkbox" name="D1" value="2">I hope this helps :-)
Good luck
touco
ps: i want duke -
Selecting from a list to a table
need help.i have items in a list and combo box in which i want it in such away that when item is selected from the list and combo box it goes to the table i have in a panel.i want to discard the text area i used.thanks in advance
my code:
'\n'
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.border.*;
import javax.swing.table.*;
public class BreakFast extends JFrame implements ActionListener{
private JList ingredient;
private JTextArea meal;
private JTable table;
private DefaultTableModel model;
private JButton move;
private String[] food;
private JComboBox box,box1;
private String[] units;
private double[] price={100,150,200,250,300,350,400};
public BreakFast(){
Container c=getContentPane();
c.setLayout(new FlowLayout());
food = new String[] {"Corn Flakes","Beans","Shredded Bread","Mushroom",
"eggs","Milks","Butter","Sugar","water","Oil"};
ingredient = new JList(food);
ingredient.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
ingredient.setVisibleRowCount(4);
JPanel p = new JPanel();
p.setBorder(BorderFactory.createBevelBorder(BevelBorder.RAISED));
//move = new JButton(">>>");
//move.addActionListener(this);
meal = new JTextArea(5,20);
meal.setEditable(false);
p.add(new JScrollPane(ingredient),"Wast");
//p.add(move,"Center");
p.add(new JScrollPane(meal),"East");
JPanel p2 = new JPanel();
p2.setBorder(new BevelBorder(BevelBorder.RAISED));
units = new String[]{"2 cups","3 cups","4 cups","5 cups","1 mudu","2 mudu",
"3 mudu","4 mudu","5 mudu","6 mudu","7 mudu","8 mudu","9 mudu",
"1 bag"};
box = new JComboBox(units);
box.addActionListener(this);
box1 = new JComboBox();
//box1.setEditable(true);
box1.addActionListener(this);
for(int i=0;i<price.length;i++){
box1.addItem(price);
model = new DefaultTableModel();
model.addColumn("No.");
model.addColumn("Food Items");
model.addColumn("Units");
model.addColumn("Price");
String[] cell={"1","Rice","2 cups","#20"};
model.addRow(cell);
table = new JTable(model);
JScrollPane pane = new JScrollPane(table);
pane.setPreferredSize(new Dimension(200,100));
p2.add(box,"North");
p2.add(box1,"South");
p2.add(pane,"East");
c.add(p);
c.add(p2);
setSize(450,300);
setVisible(true);
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
public void actionPerformed(ActionEvent e){
Object[] value = ingredient.getSelectedValues();
if(e.getSource() instanceof JComboBox){
for(int i=0;i<value.length;i++){
String word = (String)value[i];
meal.append(box.getSelectedItem()+" "+"of"+" "+word+" "+box1.getSelectedItem()+"\n");
public static void main(String[] arg){
new BreakFast();So the problem is?
All you need to do is to create the JTable first of all (which you haven't done). Secondly, you create a TableModel for it so can manage its data effectively.
Thirdly, you replace the code in your actionPerformed method to add a new row containing the data you received from the list and combo box.
Now is that so hard? Okay, here is some code
DefaultTableModel model = new DefaultTableModel(0,3);
JTable table = new JTable(model);
public void actionPerformed(ActionEvent e){
Object[] value = ingredient.getSelectedValues();
if(e.getSource() instanceof JComboBox){
for(int i=0;i < value.length;i++){
String word = (String)value;
Vector<Object> data = new Vector<Object>();
data.addElement( box.getSelectedItem() );
data.addElement( "of" + " " + word );
data.addElement( box1.getSelectedItem());
model.addRow( data );
ICE -
Send a message from a list of emails in lightswitch 2013.4 HTML screen using ajax
Hi There,
any idea how to make a button to send a message from a list of emails in lightswitch 2013.4 HTML.
my idea is to send message to all emails in the details picker (or the drop down menu or a choice list) tat is filled by SQL query (as a data source in lightswitch)
i have read many articles, most of them were written in PHP or VB !
for example:
http://www.devarticles.com/c/a/HTML/Sending-email-with-AJAX-building-a-small-application/1/
http://stackoverflow.com/questions/22442074/how-to-send-email-to-a-list-of-addresses-from-lightswitch
http://lightswitchhelpwebsite.com/Forum/tabid/63/aft/75/Default.aspx
http://maxslabyak.com/c-sharp/using-jquery-to-send-email-with-web-services/
http://www.paulspatterson.com/microsoft-lightswitch-sending-emails-from-the-client/
http://www.quercussolutions.com/blog/index.php/microsoft-lightswitch-sending-emails/
http://www.lightswitchspecial.com/2013/01/7-most-easiest-way-to-send-email-from.html
as far as i know, the HTML screens in lightswitch 2013 can be encoded with ajax only, not vb or C# any more!
my project contains only HTML screens, no desktop screens. i know that i can do the VB programming in the tables actions, but i am looking to have this code in the Browse screen to give me more flexibility depending on my decision to
send or not..
help please :)Hello Hasan,
I do this using a generic handler(e.g. sendmail.ashx). In the ashx file i use this code:
Imports System.Net.Mail
Imports System.Web
Imports System.Web.Services
Sub ProcessRequest(ByVal context As HttpContext) Implements IHttpHandler.ProcessRequest
Dim str As String = "there was no error "
Dim Recipient As String = Convert.ToString(context.Request.Params("pRecipient"))
Dim strsub As String = Convert.ToString(context.Request.Params("pSubject"))
Dim strmsg As String = Convert.ToString(context.Request.Params("pMessage"))
Dim msg As New MailMessage
Try
' Your mail address and display name.
' This what will appear on the From field.
' If you used another credentials to access
' the SMTP server, the mail message would be
' sent from the mail specified in the From
' field on behalf of the real sender.
msg.From = New MailAddress("[email protected]", "Displayname")
' To addresses
msg.To.Add("[email protected]")
'msg.To.Add(New MailAddress("[email protected]", "Friend B"))
' You can specify CC and BCC addresses also
' Set to high priority
msg.Priority = MailPriority.High
msg.Subject = strsub
' You can specify a plain text or HTML contents
msg.IsBodyHtml = True
msg.Body = strmsg
'msg.Body = _
' "Hello everybody,<br /><br />" & _
' "I found an interesting site called <a href=""http:'JustLikeAMagic.WordPress.com"">" & _
' "Just Like a Magic</a>. Be sure to visit it soon."
' In order for the mail client to interpret message
' body correctly, we mark the body as HTML
' because we set the body to HTML contents.
' Attaching some data
' msg.Attachments.Add(New Attachment("D:\Site.lnk"))
' Connecting to the server and configuring it
Dim client As New SmtpClient()
client.Host = "mail.gmx.com"
client.Port = 25
client.EnableSsl = True
' The server requires user's credentials
' not the default credentials
client.UseDefaultCredentials = False
' Provide your credentials
client.Credentials = New System.Net.NetworkCredential("yourcredentias", "f2f081639ad")
client.DeliveryMethod = SmtpDeliveryMethod.Network
' Use SendAsync to send the message asynchronously
client.Send(msg)
Catch ex As Exception
str = ex.Message
Finally
msg.Dispose()
End Try
context.Response.ContentType = "text/plain"
context.Response.Write(str)
End Sub
When you create the ASHX then replace the ProcessRequest with the above function.
In LS HTML Screen create the function for pressing a button an appen the following text:
$.ajax({
type: 'post',
data: {
pRecipient: Screen.yourdata,
pSubject: Screen.yourdata,
pMessage: Screen.yourdata,
url: '../sendmail.ashx',
success: function success(result) {
alert(result);
This is a way you can do that. In VB and out of your browse Screen.
Hope this helps
Thomas -
Get specific Strings from File
Good morning to every one.
I 've got a text file which contains a customer number and an order number, coded as we see in the picture below:
I am trying to develop a tool in Visual Studio, which it reads the file line-by-line and fills a listbox, with the order_number and the customer number. From the file above, I know that the order number are the digits on the first 'column' after the leading-zeros,
until '/', and the customer number are the digits without zeros in the 'third' column before 'CUSTOMER_NUMBER'. My form looks like:
The problem is, that the number of before the fields in file, are not equal in every line.
So, my question is how I can retrieve the 'order number' and 'customer number' from the text file and copy the results to list box, after clicking on 'Get Strings' button, like:
359962656 2238914
359562804 2238914
etc...
I attach my code here:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.IO;
namespace ReadStringFileApp
public partial class frmMain : Form
public frmMain()
InitializeComponent();
OpenFileDialog openfile = new OpenFileDialog();
//openfiledialog to pickup filename
private void btnFindFile_Click(object sender, EventArgs e)
openfile.Filter = "Text|*.txt";
if (openfile.ShowDialog() == DialogResult.OK)
lbxResults.Items.Clear();
txtFilepath.Text = openfile.FileName.ToString();
//get strings from file
private void btnGetStrings_Click(object sender, EventArgs e)
//check if there is a file path on textbox
if (txtFilepath.Text == "")
MessageBox.Show("No File Select. Please select a file", "Error File Name", MessageBoxButtons.OK, MessageBoxIcon.Error);
btnFindFile.Focus();
return;
//create list for all lines inside file
List<string> lines = new List<string>();
string line;
using (StreamReader r = new StreamReader(@txtFilepath.Text))
while ((line = r.ReadLine()) != null)
string ordernum;//string for order number
string customer;//string for customer number
//line = ordernum + "\t" + customer; //concatenate results to fill the list box
lbxResults.Items.Add(line);
r.Close(); //close file
private void btnExportToFIle_Click(object sender, EventArgs e)
//check if listbox is empty
if (lbxResults.Items.Count == 0)
MessageBox.Show("Result List is empty! Choose a file to proceed.", "Error Result List", MessageBoxButtons.OK, MessageBoxIcon.Error);
btnGetStrings.Focus();
return;
//read listbox contents and parse to a list object
List<string> list = new List<string>();
foreach (String i in lbxResults.Items)
list.Add(i);
//Create a file in c: with results
File.WriteAllLines(@"C:\export-test.txt", list, Encoding.Default);
MessageBox.Show("File export completed!", "File Export", MessageBoxButtons.OK, MessageBoxIcon.Information);
Thank you in advanced@ Joel Engineer
and@
Val10
I combined your responses and I get my results correctly. I attached the code I rewrite for further use:
private void btnGetStrings_Click(object sender, EventArgs e)
//check if there is a file path on textbox
if (txtFilepath.Text == "")
MessageBox.Show("No File Select. Please select a file", "Error File Name", MessageBoxButtons.OK, MessageBoxIcon.Error);
btnFindFile.Focus();
return;
//create list for all lines inside file
List<string> lines = new List<string>();
string line;
using (StreamReader r = new StreamReader(@txtFilepath.Text))
while ((line = r.ReadLine()) != null)
string order_customer;
Regex reg = new Regex("0*");
//set an string array, to split the file in columns positions, defining the characters
string[] daneio = line.Split(new char[] { ' ', '\t' }, StringSplitOptions.RemoveEmptyEntries);
//get order number from the first column
var ordernum_zeros = reg.Match(daneio[0]).Value;
daneio[0] = daneio[0].Replace(ordernum_zeros, String.Empty);
daneio[0] = daneio[0].Substring(0, daneio[0].IndexOf("/"));
//get customer column, without zeros
var customer_zeros = reg.Match(daneio[5]).Value;
daneio[2] = daneio[2].Replace(customer_zeros, String.Empty);
daneio[2] = daneio[2].Substring(0, daneio[5].IndexOf("CUSTOMER_NUMBER"));
//combine the result in listbox
order_customer = daneio[0] + "\t" + daneio[2];
lbxResults.Items.Add(order_customer);
r.Close(); //close file
Thank you for your help! -
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 -
i was wondering if there was a way to do an exact string search in a document.
If i have a document that has punctuation i want to be able to find the document only if i query whith an exact string match, including stopwords and punctuations.
if the query is
select *
from documents1
where contains(OBJECT_VALUE,'{hello, world}') > 0
I want only to return the documents that have exactly "hello, world" whith the comma included.
If i add the comma to printjoins, it would work, But when i query for only "hello" it wont match "hello, world"
basicaly im looking for something that does a normal search but then check if the exact string is in the match area.Try this
select substr(&P, (INSTR(&P, CHR('32'), 1))+1, (INSTR(&P, CHR('32'), 1)))
from dual
&p is a variable
I am sure this will help you in any of case
chr(32) will return space, If you have any other thing except space then you just replace 32 with that ascii code. Such as for
1(we)2 then query will be
select substr(&P, (INSTR(&P, CHR('40'), 1))+1, (INSTR(&P, CHR('41'), 1)))
from dual
Try it and tell is it working fine -
How to get multiple values from the list
I've a list of an item which I queried it from the database. I also created a button that will takes a selected items from the list when it was clicked. I used javabean to get the data from database.
<% // clicked on Select District Button
Vector vselectedDistrict = new Vector();
Vector vdistrictID = new Vector();
String tmpSelectDistrict = "";
tmpSelectDistrict = request.getParameter("bSelectDistrict");
if(tmpSelectDistrict != null)
// get multiple values from the list
String[] selectedDistrict = request.getParameterValues("usrTDistrict");
vselectedDistrict.clear();
vdistrictID.clear();
if((selectedDistrict != null) && (selectedDistrict.length != 0))
for(int i=0;i<selectedDistrict.length;i++)
vselectedDistrict.addElement(selectedDistrict);
vdistrictID = dbaseInfo.getcurrentDistrictID(nstate,vselectedDistrict);
for(int i=0;i<vdistrictID.size();i++)
out.println("district = " + selectedDistrict[i]); out.println("district ID= " + vdistrictID.get(i).toString());
%>
// get vdistrict from the database here......
<select name="usrTDistrict" size="5" multiple>
<% for(int i = 0; i< vdistrict.size(); i++)
%>
<option value="<%=vdistrict.get(i).toString()%>"><%=vdistrict.get(i).toString()%></option>
<%
%>
</select>
<input type="submit" name="bSelectDistrict" value="Select District">
Lets say the item that i selected from the list is 'Xplace' and I clicked on the Select District button,
what I got is this error message:
org.apache.jasper.JasperException: Unable to convert string 'Xplace' to class java.util.Vector for attribute usrTDistrict: java.lang.IllegalArgumentException: Property Editor not registered with the PropertyEditorManager
So where is going wrong and what the message means?. Any help very much appreciated. ThanksThese are just guesses that might hopefully steer you in directions you haven't looked in yet.
I presume you used triangle brackets (< >) to avoid having the Jive Forum think it was the "italics" tag?
Are you certain this: dbaseInfo.getcurrentDistrictID(nstate,vselectedDistrict);
expects a Vector as its second parameter? And returns a Vector?
I don't believe you've shown how you use the javabean, or its code? Perhaps it should be rewritten to accept an array of strings instead of a Vector? -
Reading items from a list view in SharePoint 2013
I am trying to read items from a Calendar, and have created a view that contains all the items/events that I would like to retrieve to package in a CSV file, specifically the Title, Description, and the Start and End Dates.
The problem with some events is that they are recurring, and rather than use CAML to expand the events and try to query it that way, I thought it would be more elegant to just get the events from the view, and package them with a simpler query.
The problem I am running in to is that I can reference the entire list and package the data, or I can reference the list and get all the data in a specific date range, which does not include the recurring events, but I cannot simply read the data from the
view.
Any pointers would be greatly appreciated. Also, can you recommend any complete-ish texts on PowerShell with SharePoint?Hi,
Based on my understanding, as there is no straight way of using CAML to query all the events(specially for instances of recurring events) by a list view, I would suggest
you separately query the instances of recurring events needed.
A code demo(though in C#) about
how to query events(include recurring events) from Calendar list in this thread for your reference:
http://social.technet.microsoft.com/Forums/en-US/99c3ded6-a8cb-4509-9a74-e93e445d78c7/how-does-calender-list-daterangesoverlap-todaymonthyear-and-week-exactly-work?forum=sharepointdevelopmentprevious
About
how to export to CSV file:
http://www.codeproject.com/Articles/667269/Export-To-CSV-file
http://www.codeproject.com/Articles/685310/Simple-and-fast-CSV-library-in-Csharp
How to export to CSV file using PowerShell:
http://shaiknb.wordpress.com/2013/05/27/powershell-sharepoint-export-list-items-via-view-to-csv/
http://meandmysharepoint.blogspot.com/2012/08/export-sharepoint-list-data-into-csv.html
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
Maybe you are looking for
-
i had just get the ios dev member confirmation code but i only got the Asus laptop intel core i-5 450M window7 and don't know how to do with my iphone 4 to try the ios5 beta, please help me out
-
No Save a Copy icon for Adobe Reader 9, using Win 7, IE or Firefox
The Save A Copy icon is no longer shown when I bring up my paycheck stub (and I am certainly authorized for that site). I can view my files but there is no icon to save the PDF to disc. It does not matter whether I go to that site with IE or with F
-
Why is it possible to scroll horizontal when there is none?
Hi there people, I hope some of you can help me out with this little problem. Put lots of effort in my new portfolio but there is one irritating thing I can't get on with. The option to scroll horizontale is constantly enabled while there is nothing
-
Workaround: Oracle Networking - LDAP export to TNSNAMES
Just posting a workaround to another silly problem: With Oracle10g, ONames is no longer supported. A reasonable alternative is to LDAP using OiD. In the docco, Oracle describes a method to export and import between OID and TNSNAMES.ORA. Specifically
-
Moving project from one VSO to another VSO and transferring ownership
Hello, I want to understand if we can move a project from VSO owned by one company to VSO owned by other company. also is there any risk of moving and any data would be lost? Is there any procedure that i need to follow and take care Kindly assit. Re