How to search a dot in a string using search command?
I want to change the format of an amount. For this i am writing the following code.
DO.
SEARCH w_l1amt FOR '.'.
IF sy-subrc IS INITIAL.
REPLACE '.' WITH ',' INTO w_l1amt.
w_pos = sy-fdpos.
ENDIF.
SEARCH w_l1amt FOR ','.
IF sy-subrc IS INITIAL.
IF w_pos NE sy-fdpos.
REPLACE ',' WITH '.' INTO w_l1amt.
ENDIF.
ENDIF.
IF sy-subrc <> 0.
EXIT.
ENDIF.
ENDDO.
I am getting 2 problems.
1) the line SEARCH w_l1amt FOR '.' is not getting success i.e. its not recognising dot.
2) As i am writing do if i replace dot manually in debug when it come to replace comma its replacing the comma which i have done in the debug also to dot again when the do repeats.
Hi ,
Dot is a special pattern character , so give three dots while searching
search str for '...'. it will search for dot.
Similar Messages
-
How can i encrypt an ddecrypt a string using java
hai,
can anybody know how to encrypt and decrypt a string using java..
please if anybody help me with a small example and with code
thanks
ravi chandrahi,
of course there are better ways to crypt your code, but the following 2 functions do their job....
as far as i know java has an own api for crypting stuff.
private String GetEncryptedString(String aCryptedString)
String result = "";
String str = aCryptedString;
int[] asciiArray = new int[str.length()];
for(int i = 0; i < asciiArray.length; i++)
asciiArray[i] = (int)str.charAt(i);
char tempChar = (char)(asciiArray[i]+3);
result = result+tempChar;
return result;
private String GetDecryptedString(String aString)
String result = "";
String str = aString;
int[] asciiArray = new int[str.length()];
for(int i = 0; i < asciiArray.length; i++)
asciiArray[i] = (int)str.charAt(i);
char tempChar = (char)(asciiArray[i]-3);
result = result+tempChar;
return result;
andi -
How to find memory taken by a process using top command
I wanted to know how to find the memory taken by a process using top command. The output of the top command is as follows as an example:
Mem: 13333364k total, 13238904k used, 94460k free, 623640k buffers
Swap: 25165816k total, 112k used, 25165704k free, 4572904k cached
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
16514 applmgr 25 0 2197m 1.7g 10m S 0.3 13.0 15:20.67 java
30692 crestelo 22 0 2901m 1.4g 9284 S 0.0 11.0 3:03.68 java
30431 crestelo 25 0 2043m 1.4g 161m S 50.9 11.0 79:02.73 java
30869 crestelo 25 0 2860m 1.2g 9292 S 0.0 9.6 7:11.18 java
16655 applmgr 23 0 1934m 1.1g 10m S 0.3 8.9 2:17.49 java
16319 crestelo 19 0 1541m 299m 44m S 0.0 2.3 2:52.11 java
I hope, my question is clear as to how to find the memory taken by a process using top command.
Please revert with the reply to my query.
RegardsHave you tried "man top" to see the documentation for the top command?
How about the following: http://lmgtfy.com/?q=show+memory+with+top+command
The 5th column (VIRT) shows the amount of RAM + swap
The 6th column (RES) shows RAM
The 7th column (SHR) shows memory shared between processes -
How to find memory taken by Oracle processes using top command
I wanted to know how to find the memory taken by Oracle processes using top command. The output of the top command is as follows as an example:
Mem: 16436072k total, 16215708k used, 220364k free, 395128k buffers
Swap: 25165816k total, 1168288k used, 23997528k free, 13366520k cached
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
27281 oraprod 15 0 6705m 1.3g 1.3g S 0.0 8.6 61:44.71 oracle
27383 oraprod 15 0 6702m 1.2g 1.2g S 0.0 7.7 2:22.75 oracle
5199 oraprod 16 0 6745m 1.1g 1.0g S 0.0 6.8 2:51.23 oracle
The different Oracle processes could be Oracle database, Oracle listener, Oracle enterprise manager etc.
I hope, my question is clear as to how to find the memory taken by a process using top command.
Please revert with the reply to my query.
Regardsa short and correct answer would be: you can't.
As oracle uses a fair amount of shared memory, and that shared memory is attached to most of the oracle processes, the same memory appears a number of times.
you should rephrase your question / what is it you want to achieve?
you can ask oracle how much memory is assigned to it, v$sga, v$sgastat, v$process (for PGA). moreover, you as DBA are the one who configured that.
you can look at major an minor faults per process to see what is causing the paging (if you have any).
you can also look at the /proc/pid/statm pseudofilesystem for your oracle pids. -
How to change the Color of a string using swings/awt concept.
Hi friends,
How can i change the Color of a string.
For ex:
If i have a string "Welcome to the Java World",I want one particular Color for the string "Welcome to the" and a different Color to the "Java World" string.
So please kindly help me out to resolve this issue.
Thanking u in advance."Text Component Features"
http://java.sun.com/docs/books/tutorial/uiswing/components/generaltext.html -
How to get numeric data from a string using t-sql
Hi All,
I have a table with 2 columns ID as Int and Message as nvarchar(max)
Create table Sample
ID int not null,
Message nvarchar(max) null,
CONSTRAINT [PK_ID_Msg] PRIMARY KEY CLUSTERED
ID asc
Insert statement:
INSERT INTO
Sample (ID, Message)
VALUES (1, 'X_YRS: 00 ; X_MONS: 18 ; X_DAYS: 000 ; Y_YRS: 00 ; Y_MONS: 16 ; Y_DAYS: 011 ; Z: 1 ; Z_DATE: 09/04/2014
INSERT INTO Sample (ID, Message) VALUES (2, 'X_YRS: 01 ; X_MONS: 15 ; X_DAYS: 010 ; Y_YRS: 00 ; Y_MONS: 18 ; Y_DAYS: 017
; Z: 1
; Z_DATE: 06/02/2012')
Data in the table looks like:
ID Message
1 X_YRS: 00 ; X_MONS: 18 ; X_DAYS: 000 ; Y_YRS: 00 ; Y_MONS: 16 ; Y_DAYS: 011 ; Z: 1 ; Z_DATE: 09/04/2014
2 X_YRS: 01 ; X_MONS: 15 ; X_DAYS: 010 ; Y_YRS: 00 ; Y_MONS: 18 ; Y_DAYS: 017 ; Z: 1 ; Z_DATE: 06/02/2012
Need out put as below, just with numeric data:
ID X-Column Y-Column
1 00 18 000 00 16 011
2 01 15 010 00 18 017
So, please I need t-SQL to get above output.
Thanks in advance.
RH
sql;With CTE
AS
SELECT s.ID,RTRIM(LTRIM(STUFF(Val,1,CHARINDEX(':',Val),''))) AS Val,RTRIM(LTRIM(LEFT(Val,CHARINDEX('_',Val+'_')-1))) AS Pattern,
--ROW_NUMBER() OVER (PARTITION BY LEFT(Val,CHARINDEX('_',Val+'_')-1) ORDER BY RTRIM(LTRIM(STUFF(Val,1,CHARINDEX(':',Val),'')))*1)
f.ID AS Seq
FROM Sample s
CROSS APPLY dbo.ParseValues(s.[Message],';')f
WHERE ISNUMERIC(RTRIM(LTRIM(STUFF(Val,1,CHARINDEX(':',Val),'')))+'0.0E0')=1
SELECT ID,
STUFF((SELECT ' ' + Val FROM CTE WHERE ID = c.ID AND Pattern = 'X' ORDER BY Seq FOR XML PATH('')),1,1,'') AS XCol,
STUFF((SELECT ' ' + Val FROM CTE WHERE ID = c.ID AND Pattern = 'Y' ORDER BY Seq FOR XML PATH('')),1,1,'') AS YCol,
STUFF((SELECT ' ' + Val FROM CTE WHERE ID = c.ID AND Pattern = 'Z' ORDER BY Seq FOR XML PATH('')),1,1,'') AS ZCol
FROM (SELECT DISTINCT ID FROM CTE)c
ParseValues can be found here
http://visakhm.blogspot.in/2010/02/parsing-delimited-string.html
Numeric check logic is as per below
http://visakhm.blogspot.in/2014/03/checking-for-integer-or-decimal-values.html
Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs -
How to disply empty cell from a string using stringtokenizer class
Hello All
I had wriiten a small program to read the string and split the string into different tuples.When i had empty cell in string i am unable to display it. Can any body help me out pls?
code given below
import java.io.*;
import java.util.StringTokenizer;
class Tokenize {
// Create BufferedReader class instance
static InputStreamReader input = new InputStreamReader(System.in);
static BufferedReader keyboardInput = new BufferedReader(input);
static String record;
/* Main method */
public static void main(String[] args) throws IOException {
//declare the string variables
String text,delim,var,delimv,vname;
String X = "x";
int i = 1;
//read the inputs from keyboard for variables and delimv
System.out.print("What is your variable names? ");
var = keyboardInput.readLine();
System.out.println("variable are :" + var );
System.out.print("What is your separator? ");
delimv = keyboardInput.readLine();
//read the inputs from keyboard for string and delim
System.out.print("What is your String? ");
text = keyboardInput.readLine();
System.out.println("String is :" + text );
System.out.print("What is your separator? ");
delim = keyboardInput.readLine();
//create the stringtokenizer class instance
StringTokenizer vt = new StringTokenizer(var,delimv);
StringTokenizer st = new StringTokenizer(text,delim);
//print the nexttokens as long as tokens and variables are available
while (vt.hasMoreTokens()) {
while (st.hasMoreTokens()) {
vname = vt.nextToken();
// if(st.nextElement() == X){
// System.out.println("filed is empty");
// System.out.println(vname + "= ");
System.out.println(vname + "=" + st.nextToken());
//nextToken());
Variables name : cat1,cat2,cat3,cat4,cat5,cat6,cat7,cat8,cat9,cat10,cat11
String name : Produkten;Voor hem;;Funny Mask ;12.50;4.90;17.40;1-5 dagen;0;http://www.eroticastore.nl/ProductDetails.asp?ProductId=21733&ReferrerId=134;http://www.eroticastore.nl/ProductImages/thumb_3300000510.jpg
Note : Empty cell is in between "Voor hem" and "Funny Mask"
Thanks In advance,
MuraliWhen you post code, please use [code] and [/code] tags as described in Formatting Help on the message entry page. It makes it much easier to read.
-
How to extract specific text from a string using REGEXP
Some- &3*1233 Test Oralce #1`2" pip, various lengths couplers Misc. Metal,,'VENDOR'), PART_NO=5966 DESCRIPTION=INV 564400 2"
How can I extract text start from 'Test' and end before DESCRIPTION? the results I need is as follows:
Test Oralce #1`2" pip, various lengths couplers Misc. Metal,,'VENDOR'), PART_NO=5966
I will apprecaite if you could explain the solution.set define off
with t as(
select 'Some- &3*1233 Test Oralce #1`2" pip, various lengths couplers Misc. Metal,,''VENDOR''), PART_NO=5966 DESCRIPTION=INV 564400 2"' str from dual
select regexp_replace(str,'(^.*)(Test.*)( DESCRIPTION.*$)','\2') result
from t
RESULT
Test Oralce #1`2" pip, various lengths couplers Misc. Metal,,'VENDOR'), PART_NO=5966
SQL>
{code}
SY. -
How to display Columns in Alphabatical order when using DESC command
Hello
A table column is inserted not in alphabetic order during the table creation definition.
So while describing the table definition (e.g. desc emp)
it will not show in the same order as we are written during the table creation.
Question: is there any utility/command/query which will display the columns in alphabatical order while describing it.
Regards
Nikhil Waniselect column_name from user_tab_columns
order by column_name;
should do it.
Sunil -
How to enable Rosetta at the system level using the command line?
I need to find a way to enable Rosetta at the system level (e.g. all users) using the command line. When Rosetta is enabled, the following entry is created in ~/Library/Preferences/com.apple.LaunchServices (run defaults read com.apple.LaunchServices)
LSPrefsFatApplications = {
"com.apple.Safari" = (
<00000000 009a0003 00010000 c323458f 0000482b 00000000 00000023 0000727b 0000c2b0 8b4e0000 00000920 fffe0000 00000000 0000ffff ffff0001 00040000 0023000e 0016000a 00530061 00660061 00720069 002e0061 00700070 000f0014 00090053 00650072 00760065 00720020 00480044 00120017 4170706c 69636174 696f6e73 2f536166 6172692e 61707000 00130001 2f00ffff 0000>
Does anyone know what the data shown here is? It doesn't change when Rosetta is turned off and then back on. It also doesn't change between user accounts (e.g. joe's com.apple.LaunchServices.plist has the same value as jane's).
Will it be possible to run defaults in a way that makes this change work for all users of the computer?I am asking about the option to run in non-interactive modeIt cannot be done. Check "Oracle® Applications Maintenance Utilities Release 11i (11.5.10.2)" manual for more details.
-
How to skip and restart a failed worker using ADCTRL command line?
To skip and restart a failed worker, we can start adctrl, use hidden option (7 or 8 depending on the version).
Is it possible to do the same from command line?
Thanks in advance.
S. SundarI am asking about the option to run in non-interactive modeIt cannot be done. Check "Oracle® Applications Maintenance Utilities Release 11i (11.5.10.2)" manual for more details.
-
How to not be prompted for pwd when using sftp command
Hello -
I want to be able to run an sftp command in a shell script without being prompted for a password, but am not having success.
Here is my script:
sftp -oPort=34333 [email protected]
bye
exit
Any ideas are greatly appreciated!
Thanks!From Local Computer (follow the prompts at each stage).
1. Login to the localcomputer as required user and generate a pair of authentication keys using keygen
ssh-keygen -t rsa
2. Login to the remotecomputer as required user and create the .ssh directory
ssh -l remoteuser remotecomputer mkdir -p .ssh
3. Copy the Local user public key to Remote User .ssh directory into authorized_keys file. And, type the password again for the last time
cat .ssh/id_rsa.pub | ssh -l remoteuser remotecomputer 'cat >> .ssh/authorized_keys'
4. Connect to the remotecomputer using ssh, sftp or scp . For ssh e.g.
ssh -l remoteuser remotecomputer
This might work, but you need to check it up to correct any mistakes I make with the commands because I am just typing it without testing -
How can I check the virtual-address up using show command in ACE?
I want to check the virtual-address using show command.
however, there are not in ACE. So I used the ping to check virtual-address status in ACE
I want to know the command what is verify virtual-address status , using show command
Thank :)Try -> show arp
There you have a Type column and a Status column.
Look for the entry "VSERVER" in the Type column
Roble -
How to send a file as an attachment using mailx
Hi
Can any one tel me how to send a file as an attachment using mailx command in shell script.
Thanks,
Suman.Wrong forum where to ask such questions.
Check this one link:
http://www.unix.com/shell-programming-scripting/18370-sending-email-text-attachment-using-mailx.html?t=18370#post70254 -
How to search a special string in txt file and return it's position in txt file?
How to search a special string in txt file and return it's position in txt file?
I just posted a solution for a similar question here: http://forums.ni.com/ni/board/message?board.id=170&view=by_date_ascending&message.id=362699#M362699
The top portion can search for the location of a string, while the bottom portion is to locate the position of a character. Both can search for a character.
The position of the character within the file is displayed in the indicator(s).
R
Maybe you are looking for
-
Persistent but Inconsistent iTunes Runtime Error Message...
A while ago, I started getting a runtime error message when I'd open iTunes. "Microsoft Visual C++ Runtime Library Runtime Error! Program: C:\Program Files\iTunes\iTunes.exe This application has requested the Runtime to terminate in an unusual way."
-
Strange behavior OS 10.4.6 in one user area
I'm experiencing some odd behavior in OS X that I can't explain. My problem is in Skype, and while I know we're not here to comment on third-party software, it's not appearing now to be a Skype problem, but a possible generic OS X issue. So basically
-
Capturing using Cannon XHA1 on Pro CS6
Can anyone help me with capturing using Cannon XHA1 on CS6? When I capture using DV mode only the black screen appears and there isn't any capture duration, no frames are being captured.
-
Hi I need some help to save couple of time managing profile settings for every user in our Agency. We use 10.6 Server, 10.6 on the clients and the Adobe Design Standard CS5. To use Adobes CS5 in a good way, many settings need to be stored in the user
-
Best Tool for Voice Editing?
Hi everyone, I produce a few podcasts done in Second Life using thier somewhat dodgy voice client, and skype and talkshoe and things like this. The quality of the recorded audio can be less than stellar, as you can imagine.. So, I don't write songs,