How to replace a specific character acording to position
hi,
tablename
column name
00000111111
so,
i need to update 6 th position only.
I am not sure whether there is a direct inbuilt SQL function for this facility. I am giving a method to get this as below:
Logic:
1. Get the substring from first position to the required position minus 1 into the result string
2. Concat the required character to the substring in the above step (result string).
3. Concat the substring from required position plus 1 to the result string
SQL below:
select substr('00000111111',1,6-1) || '1' || substr('00000111111',6+1) from dual
Similar Messages
-
How to replace a specific color with transparent color?
I would need to get image of a control but I'd like to replace the background color of the control with transparent color (like the commentest image editor).
I cannot use IMAQ library, so I would like to use 2D-picture palette.
I can read the image data pixel per pixer, but.. once the color to be replaced is found, how to replace it with transparent?
Thanks allIt sounds like you want the "Create Mask.vi". If not, you might want to provide some code that shows what kind of situation you're dealing with.
-
Function to replace/delete specific character(s) in a string
Hi, experienced CVI guys,
Are there some functions shipped with CVI to replace or delete specific characters in a string?
For example, I want to replace all \/|- with an empty string, or to delete them. What can I do? Loops are too complex.
Original string:
Erasing Device...
\|/- \ \ \\|/-\|/ \
Report
07-Sep-2010, 08:04:55
Result I want is
Erasing Device...
Report
07-Sep-2010, 08:04:55
Thanks.
Solved!
Go to Solution.labc:
How generic do you want to make your filter?
For our discussion, I'll call your series of characters a text spinner. I'm assuming the number of characters in it may vary, but that the pattern is consistent in the respect: the spinner is made up of characters like \ / | -, each followed by the ASCII backspace (char) 8. (That's 8 cast as a character, which is not the same as '8'.) In your sample spinner pattern, every occurrence of the ASCII backspace is preceded by one of the spinner characters. Let's assume that this pattern is constant.
So what I'd do is search through your input string (yes, using a loop) and copy the input string byte by byte to an output string. If you find an ASCII backspace in the input string, skip it, and overwrite the last character in the output string (which is one of the spinner characters) with the next character in the input string.
Yes, you are using a loop, but it's not too complex.
Here's the whole loop, written as a function.
// filterSpinner function to strip the text spinner characters out of a string.
// The text spinner is made up of \ / | - characters separated by (char) 8 (ASCII backspace)
int filterSpinner(char *inputString, char *outputString)
int inputPtr, outputPtr = 0;
// walk though the input string
for (inputPtr = 0; inputPtr < strlen(inputString); inputPtr++, outputPtr++)
// search for the ASCII backspace character that's part of the spinner
if (inputString[inputPtr] == 8)
// if the ASCII backspace is found,
inputPtr++; // increment the inputString pointer to skip the backspace
outputPtr--; // decrement the outputString pointer to overwrite
// the spinner character that preceded the backspace
outputString[outputPtr] = inputString[inputPtr];
outputString[outputPtr] = '\0';
return 0;
You'll also find an attached CVI program which uses it on your sample string.
Attachments:
FilterSpinner1.zip 5 KB -
Hi everyone,
I have a txt file and It has some data's. I want to specifically replace a character in the text file. Data's will be like this,
TT=15
S1ST=21601
S1EN=50400
S2ST=50401
S2EN=72000
S3ST=72001
S3EN=21600
GNST=00000
GNEN=00000
S1B1S=22800
S1B1E=23400
S1B2S=28800
S1B2E=30600
S1B3S=36000
S1B3E=36600
S1B4S=45000
S1B4E=46800
In the 2nd line i.e. S1ST=21601, I want to replace 36000 instead of 21601.
After replacing the specific character, data's should overwrite in the file or appending the file will also ok for me.
Give me a suggestion. I am using LV 8.2. So plz post your code in 8.2 ver
Thanks in advance.
Regards,
Vijay
Solved!
Go to Solution.Check this out.
Edit:- attaching 8.2 version
With Regards
Miraz
Kudos is better option to thank somebody on this forum
Attachments:
String.vi 8 KB
String.vi 8 KB -
How to select a substring in oracle up to a more than one specific character
How to select a substring in oracle up to a more than one specific character
for ex : 121.051^NP: FAMILY PRACTICE ( trim the values before ^ )
121.051^*NP: FAMILY PRACTICE (trim the value before *).
with below function I can only get rid of ^ , I want both the specific characters ^ and ^* to be removed at the same time.
SUBSTR(p.phys_sub_grp_2_desc,INSTR(p.phys_sub_grp_2_desc, '^') +1)Another option is to boldly replace 'em:
SQL> with t as (
2 select '121.051^NP: FAMILY PRACTICE' str from dual union
3 select '121.051^*NP: FAMILY PRACTICE' from dual
4 )
5 --
6 -- actuel query:
7 --
8 select substr( replace(str, '*')
9 , instr(replace(str, '*'), '^')+1
10 ) str
11 from t;
STR
NP: FAMILY PRACTICE
NP: FAMILY PRACTICE
2 rows selected. -
How do I globally replace a bold character override in FM10?
How do I globally replace a bold character override with a specific character format from the character format catalog in FM10? I am not concerned about filtering for specific paragraph tags.
Thanks,
MarcThis is far as I've managed …
apply the character style in question to a word, then use Edit > Copy special to put the character style in the clipboard
use Find/change to locate Character format override
if this finds a local override you want to clean up, click [Change & find]
Not global in the sense "sort out my whole book with one click", but perhaps a step in the right direction.
Off-thread question: what's the general feeling about formatting for step 3 – is it OK to be informal and start an instruction with "if"? I like to explain the condition before giving the instruction, to avoid tripping up people like me who tend to process strictly from left to right :-} An indented paragraph after step 2 "If … then continue to step 3" would be thorough, but seems a bit clumsy. -
How to replace a character at a random position of a column in SQL Server 2000?
Hello everyone,
I'm trying to export the data of a table into a flat file. However, when I try to export it, a column which has a specific character (".") is being loaded as a new column into the file rather than the same column.
Here is the DDL/DML:
CREATE TABLE [dbo].[EXT_Name](
[A_Name] [VARCHAR](4),
[U_Name] [VARCHAR](256),
[U_Desc] [VARCHAR](256),
[Acc_Desc] [VARCHAR](256),
[S_Type] [VARCHAR](50))
Its just that's it. No more Keys and Indexes on this table.
Here is the bcp command I'm running:
EXEC [master].[dbo].[xp_cmdshell] 'bcp "SELECT * FROM [dbo].[Ext_Name]" queryout C:\Data\Ext_Name.dat -c -t, -T -S'
Data:
GEHG,/User/Personal/Project/Click.do,Search for User Project.,See Summary,Summaries
GEHG,/User/Personal/Project/Click.do,Search for User Project.Detail,null,Summaries
Instead for the data to be loaded as the above, its loading into the file as
GEHG,/User/Personal/Project/Click.do,Search for User Project.,See Summary,Summaries
GEHG,/User/Personal/Project/Click.do,Search for User Project.Detail
,null,Summaries
This issue occurs only when [Acc_Desc] column has the "." character in between the string. Could experts in this forum help me please?
Thank you,
Bangaaram
Known is a DROP, Unknown is an OCEAN.That is most likely not your problem. Your problem is most likely the source data has a CR and/or LF after it in the database.
Run this to remove them from Acc_Desc:
UPDATE [dbo].[EXT_Name]
SET [Acc_Desc] = REPLACE(REPLACE([Acc_Desc],CHAR(13),''),CHAR(10),'')
Perfect! Thank you Tom :)
Known is a DROP, Unknown is an OCEAN. -
How to replace a character in a string with blank space.
Hi,
How to replace a character in a string with blank space.
Note:
I have to change string CL_DS_1===========CM01 to CL_DS_1 CM01.
i.e) I have to replace '=' with ' '.
I have already tried with <b>REPLACE ALL OCCURRENCES OF '=' IN temp_fill_string WITH ' '</b>
Its not working.Hi,
Try with this..
call method textedit- >replace_all
exporting
case_sensitive_mode = case_sensitive_mode
replace_string = replace_string
search_string = search_string
whole_word_mode = whole_word_mode
changing
counter = counter
exceptions
error_cntl_call_method = 1
invalid_parameter = 2.
<b>Parameters</b> <b> Description</b> <b> Possible values</b>
case_sensitive_mode Upper-/lowercase false Do not observe (default value)
true Observe
replace_string Text to replace the
occurrences of
SEARCH_STRING
search_string Text to be replaced
whole_word_mode Only replace whole words false Find whole words and
parts of words (default
value)
true Only find whole words
counter Return value specifying how
many times the search string
was replaced
Regards,
Jayaram... -
How do I find & replace a single character?
Am using Adobe Acrobat Pro....
The find/replace box pull down has "Whole Words Only" checked and I cannot uncheck it. How can I find and replace a single character throughout a document?That's just how it works. You can "find" anything, but you can only "replace" whole words. As soon as you click to open the "replace" section of the dialog the search settings are locked into their basic states, even if you don't enter a replacement string (but that part's a bug).
The simple answer is that you cannot replace all instances of one character using Acrobat's inbuilt tools. You're expected to edit the document outside of PDF and recreate it. -
How to replace key value with character
Hi Experts
Can any one tell me, how to replace key value with character, whether it is possible are not. My present report is displaying below format.
country--city-area-flatnocountry--City-Flatno
Customer--USACOst1111---UK--HD20--
C100--11---11--
C200--11---1--
For the above example format i am able to display. But now i want to replace 1 with character value for example. For C100
country is USA at presnt 1 but it should replace with USA.
You find required format below.
country--city-area-flatnocountry--City-Flatno
Customer--USACOst1111---UK--HD20--
C100--USACOst1111--
C200--UK--HD20--
thanks .
Regards,
Vishal.Hi Markus,
Thanks for reply,
Actually i dont have attribute for the customer, the data is maintained in ods, in the form, customer name one info-object and customer value one more info-object this value got text. This value stored in the ods as below
costomer number customer value
C100--USA
-C100CO
C100--11-
C200----
UK
C200----
20
Please let me know any clarification you need.
Thanks and Regards,
Vishal. -
How can I read a specific character from a text file?
Hi All!
I would like to read a specific character from a text file, e.g. the 2012th character in a text file with 7034 characters.
How can I do this?
Thanks
Johannesjust use the skip(long) method of the input stream that reads the text file and skip over the desired number of bytes
-
How to replace/remove/change font color of a character at in output
Hi all,
I am using rtf template to get the output of a report, however i have a condition for field "Narratives" where if field A contains 'X', I need to either get rid of the 'X', replace with '' or change the font of X to white.
Meaning if the output is : My Name is BavaniX
I need it to look like : My Name is Bavani
I use the BI Publisher desktop tool to create the placeholders. Highly appreciate if someone could advise me on how to replace with '' or change X to white font or remove the X using the BI desktop tool.
The placeholder right now looks like this <?(NARRATIVES)?>.
Thank you.if you want to replace also look at
How to remove underscore in xml tag
Re: How to remove underscore in xml tag
Edited by: AlexAnd on Aug 2, 2012 5:55 AM -
HOW TO REPLACE CHARACTER IN JTextField WHEN THE USER TYPES
hOW TO OVERWRITE THE EXISTIG CHARACTER IN THE jtEXTfIELD INSTEAD OF INSERTING IN A jtEXTfIELD ?
ANY HELP IS APPRICIATEDYour keyboard is broken. I suggest you fix it if you want help in the future because using capital letters appears like "SHOUTING" and we don't like to shouted at.
Anyway you wouldn't use a DocumentListener, because the Document has already been updated by the time the Document event has fired.
You might be able to use a DocumentFilter, which is also discussed in the above tutorial.
Or, you can search the forum for my "Overtype TextArea" (without the spaces) example that may do what you want. -
Hi. all.
I am wondering how oracle replace "carrage return, tab and blank" character to v$sql.sql_text??
I am try to find sql_id by the following query.
select * from v$sql where sql_text like 'blur blur %'.
However, how can I specify 'blur blur %' when the original sql text includes "carrage return, tab, amd double blank"?
To be more specific,
the original sql statement:
select
col_a,
col_b , -- tab character included
colc , -- more than one blank included
Then, how can I specifiy "sql_text like 'blur blur %'" ??
As far as I know, oracle replace "carrage return, tab, and more than one blank" to "ONE BLANK" character.
Is this right???
Thanks in advance.
Best Regards.Oracle simply unformat the SQL text and put it into v$sql.sql_text because SQL formatting is only for reading and clearity purpose. It don't help to generate SQL_ID and execution plan. You may get couple of freely avilable SQL formatting tool on the internet, you can simply copy SQL_TEXT and if you paste them into those tool, they will auto format, tab, upper and lower case of required words.
If you find this reply helpful or correct, please mark accordingly because you asked 17 questions and zero answerred. This seems that this forum is 0% useful to you! (sad)
Regards
Girish Sharma -
How to replace NULL values from main table
Dear all,
I like to remove the NULL values from a main table field. Or the question is how to replace any part of the string field in MDM repository main table field.
e.g. I have a middle name field partly the value is NULL in some hundreds of records, I like to replace NULL values with Space
any recommendation.
Regards,
NaeemHi Naeem,
You can try using Workflows for automatically replacing NULLs with any specific value.
What you can do is: Create a workflow and set trigger action as Record Import, Record Create and Record Update. So, that whenever any change will occur in the repository; that workflow will trigger.
Now create an assignment expression for replacing NULLs with any specific value and use that assignment expression in your workflow by using Assign Step in workflow.
For exiting records, you will have to replace NULLs manually using the process given by Preethi else you can export those records in an Excel spreadsheet which have NULLs and then replace all NULLs with any string value and then reimport those records in your MDM repository.
Hope this will solve your problem.
Regards,
Varun
Edited by: Varun Agarwal on Dec 2, 2008 3:12 PM
Maybe you are looking for
-
Brand new iPod touch having syncing problems
I bought a brand new iPod touch 4th generation to replace my 3rd generation one. When I first plugged it in, almost everything synced over. After I noticed my notes, calender, photos, and previously saved wallpaper photos didn't transfer over, I sync
-
HP officejet Pro 8600 Not connecting right to my new Mac Pro Air. Looses signal.
I recently bought a Mac Book Air. I have a wireless HP Officepro Jet 8600 that sometimes works for printing and a lot of times it does not get the signal. I am ready to throw my HP out the window. Had tech come in twice. Gets it and than it looses th
-
How to properly get rid of the SATA drives in "Safely Remove Hw"(systray Icon)
If you have the nvidia ide and or raid enabled (using the nv/sw ide driver) you have the drives listed under add/remove hw icon in systray . To have it gone from now and forever use this dword in registry . Code: [Select] Windows Registry Editor Vers
-
Can we debug the dynamic action code
Dear Freinds, I want to debug the standard code written for dynamic action for infotype 0002 and to that of infotype 0021. How can i debug is there any standard program for dynamic action please let me know . regards divya.
-
Why do I get repeated events on my iPhone and iPad when I use iCloud
I decided quite a while ago to try the icloud when I bought my iPhone. On my Mac I synched it to iCloud for both my iPad and iPhone, but in my calendar, I ended up with multiple/repeated events on each device. So I swithched to synching only to my