CSV format delete/remove space
Hi Friends,
I am facing a problem. I am UP LOADING data into CSV format. After upload file if i see into the file i am getting spaces in right side of the value. How can i remove the spaces or how the value move to right side of the colomn.
Regards,
Kumar
Hi Rob,
Concatenate all your ITAB in to another itab.and send to function module.
ex: loop at itab into wa_itab.
concatenate wa_itab-f1 wa_itab-f2 wa_itab-f3 wa_itab-f4 ...
into wa_itab2.
append itab2 from wa_itab2.
endloop.
pass itab2 to function module.
i hope this will solve your problem.
Similar Messages
-
Unable to save the data in a .CSV format
Hi All,
I am trying to pull some data with the help of the sql query from the database and then trying to save this string of data in csv file by using the following code as shown below.The problem iam facing here is that while the file Save as window opens stating to be saved as .CSV format but when i try to save it ,it doesnt givme a csv option ,only html option appears.Can any one help me on this..,,,,,,,,,,,,?
<%@include file="jtfincl.jsp" %>
<%@page session="false" %>
<%@page import="java.io.PrintWriter"%>
<%@page import="oracle.apps.ibe.util.RequestCtx"%>
<%@page import="oracle.apps.iri.iribe.postsales.IrIbeOrderSearch"%>
<%@page import="oracle.apps.ibe.util.*" %>
<%@page import="java.io.IOException" %>
<%
pageContext.setAttribute("_securePage", "true", PageContext.REQUEST_SCOPE);
pageContext.setAttribute("_guestNotAllowed", "true", PageContext.REQUEST_SCOPE);
pageContext.setAttribute("_unapprovedNotAllowed", "true", PageContext.REQUEST_SCOPE);
RequestCtx rCtx = RequestCtx.start(request, response);
int status = Session.checkContextValues(request, response);
if(RequestCtx.userIsAnonymous()) {
signin(out, pageContext, request, response, false);
return;
// Set the response type which in this case will be a .csv file
response.setContentType("application/csv");
response.setHeader("Content-disposition","attachment;filename=SearchResults.csv");
String queryStartDate = request.getParameter("queryStartDate");
String queryEndDate = request.getParameter("queryEndDate");
String queryField = request.getParameter("queryField");
String queryOperator = request.getParameter("queryOperator");
String queryValue = request.getParameter("queryValue");
String queryOrderByField = request.getParameter("queryOrderByField");
String showOpenOrdersOnly = request.getParameter("showOpenOrdersOnly");
IrIbeOrderSearch orderSearch = new IrIbeOrderSearch(
queryStartDate,
queryEndDate,
queryField,
queryOperator,
queryValue,
queryOrderByField,
showOpenOrdersOnly
orderSearch.initialise();
java.util.ArrayList results = orderSearch.getItemTrackerSearchResults();
out.println("The result array size is======="+results.size()) ;
// Output the results as the page resonse as a csv file
try
write(results, response.getWriter());
catch(exception e)
out.println("The stack trace is======="+e.printStackTrace()) ;
if(IBE_logEnabled) IBEUtil.log("iribeCOtdOrdSearchExport.jsp","Inside the exception"+e.toString);
%>
<%!
* This method will take a ResultSet and JspWriter object and print out the details of the ResultSet as a
* comma seperated value file.
* @param results
* @param writer
public static void write(java.util.ArrayList results, PrintWriter writer) {
if(results == null || results.size() == 0) {
writer.print("No Data Available");
return;
String [] data = null;
String output = "";
if(IBE_logEnabled) IBEUtil.log("iribeCOtdOrdSearchExport.jsp","Inside the write method");
for(int i = 0; i < results.size(); i++) {
data = (String []) results.get(i);
output = "";
for(int j = 0; j < data.length; j++) {
// If its not the last column
if(j != data.length - 1) {
output += formatField(data[j]) + ",";
// If it is the last column
} else {
output += formatField(data[j]);
writer.println(output);
writer.flush();
* Format a string value so that it becomes a valid field in a .csv file. This involves making sure that any null
* data is treated as an empty string, that any quotes are padded and if the file contains any commas that the
* field is surrounded by quotes.
* @param value
private static String formatField(String value) {
String output = null;
// Check for null values
if(value == null) {
output = "";
} else {
output = value;
// Pad any existing quotes
output = output.replaceAll("\"", "\"\"");
// If there is a space or commas then add surrounding quotes
if(output.startsWith(" ") || output.endsWith(" ") || output.indexOf(",") != -1) {
output = "\"" + output + "\"";
return output;
%>
<%!
void signin(
JspWriter out,
PageContext pageContext,
HttpServletRequest request,
HttpServletResponse response,
boolean reauth
) throws IOException, SQLException, FrameworkException {
String query = IBEUtil.passQueryString(request, null).toString();
String uri = request.getRequestURI();
String targetJsp = uri.substring(uri.lastIndexOf("/") + 1);
String ref = null;
if ("true".equals(pageContext.getAttribute("_securePage", PageContext.REQUEST_SCOPE))) {
ref = RequestCtx.getSecureFormAction(targetJsp);
} else {
ref = RequestCtx.getNonSecureFormAction(targetJsp);
if(!query.equals("")) {
ref = oracle.apps.jtf.util.Utils.encode(ref + "?" + query);
String redirect = RequestCtx.getSecureURL("ibeCAcpSSOLogin.jsp", "ref=" + ref + (reauth ? "&reauth=t" : ""));
// don't add the ref if the session expired and restarted
RequestCtx rCtx = RequestCtx.getRequestCtx();
if(rCtx.startRequestException!=null) {
redirect = RequestCtx.getSecureURL("ibeCAcpSSOLogin.jsp", "ibe_se=t"+(reauth ? "&reauth=t" : ""));
RequestCtx.end(request);
response.sendRedirect(redirect);
regds
manish
%>This would occur if you were using IE and the requested URL doesn't contain the filename part. The real web browsers would pick up the filename from the response header flawlessly.
Having said that, this kind of logic doesn't belong in a JSP. Use Java classes (Servlet, Bean, DAO). Further on, JSP/Servlet related questions should be posted in the JSP/Servlet forum. -
In an Apex report SQL query, i had written a statement for the column as
'<div style="width: 260px;">'|| PARTY_NAME || '</div>' as PARTY_NAME to avoid wrapping of the column text.
Now, when i download the report in csv format, i get the output in PARTY_NAME column as follows:
<div style="width: 260px;">SELF</div> instead if SELFPlease suggest the solution.
YogeshHi,
Remove HTML from select.
Add this to page HTML header
<style>
#apexir_PARTY_NAME{width:260px!important}
</style>Br,Jari
Edited by: jarola on Jan 21, 2010 9:32 AM
Code corrected -
Download Internal Table in CSV format it gets downloaded in single column
Hi All
I am converting Internal Table in CSV format using the FM CONVERT TO CSV FORMAT and then downloading data using GUI_DOWNLOAD FM.
I have given separator as ','.
However when I download the data the file is opened in Excel and first 2 to 3 column are merged in to single column and there was separator shown ';'.
How to overcome this problem.
AmolhI..,
Check this code..
<b>
It first downloads the data in internal table to a CSV format file..
and then uploads the same data into another internal table and prints it..</b>
analyze this and use accordingly..
tables:
spfli.
field-symbols : <fs>, <fs1>.
data:
w_line(1000),
w_field(20) type c,
wa_spfli type spfli.
data:
begin of fs_spfli,
carrid type spfli-carrid,
connid type spfli-connid,
countryfr type spfli-countryfr,
countryto type spfli-countryto,
fltime type spfli-fltime,
end of fs_spfli.
data :
t_file like standard table
of w_line
initial size 0.
data:
t_spfli like
standard table
of fs_spfli
initial size 0.
data:
t_spfli_up like
standard table
of fs_spfli
initial size 0.
select carrid
connid
countryfr
countryto
fltime
into corresponding fields of table t_spfli
from spfli.
loop at t_spfli into fs_spfli.
do.
assign component sy-index of structure fs_spfli to <fs>.
if sy-subrc ne 0.
exit.
endif.
w_field = <fs>.
condense w_field no-gaps.
if sy-index eq 1.
w_line = w_field.
else.
concatenate w_line ',' w_field into w_line.
endif.
enddo.
append w_line to t_file.
endloop.
call function 'GUI_DOWNLOAD'
exporting
BIN_FILESIZE =
filename = 'D:\file.txt'
filetype = 'ASC'
APPEND = ' '
write_field_separator = ' '
header = '00'
TRUNC_TRAILING_BLANKS = ' '
WRITE_LF = 'X'
COL_SELECT = ' '
COL_SELECT_MASK = ' '
DAT_MODE = ' '
CONFIRM_OVERWRITE = ' '
NO_AUTH_CHECK = ' '
CODEPAGE = ' '
IGNORE_CERR = ABAP_TRUE
REPLACEMENT = '#'
WRITE_BOM = ' '
TRUNC_TRAILING_BLANKS_EOL = 'X'
WK1_N_FORMAT = ' '
WK1_N_SIZE = ' '
WK1_T_FORMAT = ' '
WK1_T_SIZE = ' '
IMPORTING
FILELENGTH =
tables
data_tab = t_FILE
FIELDNAMES =
exceptions
file_write_error = 1
no_batch = 2
gui_refuse_filetransfer = 3
invalid_type = 4
no_authority = 5
unknown_error = 6
header_not_allowed = 7
separator_not_allowed = 8
filesize_not_allowed = 9
header_too_long = 10
dp_error_create = 11
dp_error_send = 12
dp_error_write = 13
unknown_dp_error = 14
access_denied = 15
dp_out_of_memory = 16
disk_full = 17
dp_timeout = 18
file_not_found = 19
dataprovider_exception = 20
control_flush_error = 21
others = 22.
if sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
endif.
clear t_FILE.
call function 'GUI_UPLOAD'
exporting
filename = 'D:\file.txt'
FILETYPE = 'ASC'
HAS_FIELD_SEPARATOR = 'X'
HEADER_LENGTH = 0
READ_BY_LINE = 'X'
DAT_MODE = ' '
CODEPAGE = ' '
IGNORE_CERR = ABAP_TRUE
REPLACEMENT = '#'
CHECK_BOM = ' '
VIRUS_SCAN_PROFILE =
IMPORTING
FILELENGTH =
HEADER =
tables
data_tab = t_FILE
EXCEPTIONS
FILE_OPEN_ERROR = 1
FILE_READ_ERROR = 2
NO_BATCH = 3
GUI_REFUSE_FILETRANSFER = 4
INVALID_TYPE = 5
NO_AUTHORITY = 6
UNKNOWN_ERROR = 7
BAD_DATA_FORMAT = 8
HEADER_NOT_ALLOWED = 9
SEPARATOR_NOT_ALLOWED = 10
HEADER_TOO_LONG = 11
UNKNOWN_DP_ERROR = 12
ACCESS_DENIED = 13
DP_OUT_OF_MEMORY = 14
DISK_FULL = 15
DP_TIMEOUT = 16
OTHERS = 17
if sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
endif.
clear fs_spfli.
*constants :
*C_HTAB value CL_ABAP_CHAR_UTILITIES=>HORIZONTAL_TAB.
loop at t_file into w_line.
do.
if w_line eq space.
exit.
endif.
split w_line at ',' into w_field w_line.
condense w_field no-gaps.
assign component sy-index of structure fs_spfli to <fs>.
<fs> = w_field.
enddo.
append fs_spfli to t_spfli_up.
endloop.
loop at t_spfli_up into fs_spfli.
do.
assign component sy-index of structure fs_spfli to <fs>.
if sy-subrc ne 0.
exit.
endif.
write <fs>.
enddo.
skip.
endloop.
reward if it helps u..
sai ramesh -
How to remove space after paragrph in pages on ipad
Can't figure out how to remove space after each paragraph in Pages for Ipad
Settings > General > International > Region Format
Set it to your country to format numbers and dates in the way your country does. -
Creating DataSources for File Source Systems in csv format in sap bw 7.0
Hi,
Please explain how to Create DataSources for File Source Systems in csv format in sap bw 7.0. WITH SCREENSHOTS
Thanks
JINI
Edited by: Jini Jayan on Jun 11, 2008 11:36 AMStep 1. Select Source systems under Modelling in the left panel. In the right panel, right-click Source systems and select Createu2026.
Step 2. Select the FileSystem, manual meta data, data using file inte option, and then click to continue.
Step 3. Enter a name and a description for the source system, and then click to create the source system.
Now create an application component
Step 1. Select InfoSources under Modelling in the left panel. In the right panel, right-click InfoSources and select Create application componentu2026.
Step 2. Enter a name and a description for the application component, and then click to continue. (BW automatically adds a prefix of "Z" to the technical names of application components, unlike the naming system used for other BW objects.If u give the name as AC_DEMO it will be saved as ZAC_DEMO in the system.
Now create infosource
Step 1.Select InfoSources under Modelling in the left panel. Right-click the newly created Application Component , and then select Create InfoSourceu2026.
Step 2. Select the option Master data/texts/hierarchies, and then click to continue.
Step 3. Enter your infoobject name, and then click to continue.
Now you will be asked
Infosource(name) assigned to Appln component(name)?
Click continue
Now go back to workbench and see the Infoobject listed under the Application component name (under Infosource)
Right click the infoobject name and select Assign Datasource
Enter the Infoobject name as Infosource name and the source system name and continue
Now you ll get datasource assignment confirmations for Infosource_ATTR and Infosource_TEXT for master data and text.
Click yes and continue
Now you ll be taken to the Infosource(master data) change screen
Source system name will be given
Below that u need to give the datasource name u2026.._ATTR
Click Activate.
Now Click the tab transfer rules
Copy the communication str infoobject names to an excel sheet
For ex if your infoobj are IO_MATNUM and IO_MATNAME (material number and material name) copy and paste as
IO_MATNUM IO_MATNAME
MAT001 TEA
MAT002 COFFEE
MAT003 SUGAR
GIVE YOUR DATA IN THE EXCEL. AND CLICK File Save As CSV(comma delimited) and save to ur system. Give file name as something like infosourcename_ATTR.csv
Now back to the Infosourcechange screen
Source system name will be given
Below that u need to give the datasource name u2026.._TEXT
And activate
Now Click the tab transfer rules
Copy the communication str infoobject names to an excel sheet
GIVE YOUR DATA IN THE EXCEL. AND CLICK File Save As CSV(comma delimited) and save to ur system. Give file name as something like infosourcename_TEXT.csv
Now create Infoobject to load data
Go to Infosourceu2014Appln Componentu2014InfoObju2014SourceSystemu2014rightclick->create Infopackage
Step 2. Select the DataSource Material number (Master data), enter a description for the InfoPackage, and then click to continue.
Give infopackage description as Infopackage:InfoObj_ATTR
Now take care to select the first item in datasource and click continue
In the next screen click external data tab
Click client workstation
Datafileu2026.file name (browse to give the file u saved in ur system)
There will be an option to remove header data from file.remove 1 row.
File typeu2014csv file
Now click schedule tabu2014start dataload immediatelyu2014start.
In the same way
Go to Infosourceu2014Appln Componentu2014InfoObju2014SourceSystemu2014rightclick->create Infopackage
Step 2. Select the DataSource Material number (text)enter a description for the InfoPackage, and then click to continue.
Give infopackage description as Infopackage:InfoObj_TEXT
Now take care to select the second item in datasource and click continue
In the next screen click external data tab
Click client workstation
Datafileu2026.file name (browse to give the file u saved in ur system)
There will be an option to remove header data from file.remove 1 row.
File typeu2014csv file
Now click schedule tabu2014start dataload immediatelyu2014start.
Click the icon below admn workbench to go to monitor and check the load
Or you go back to Infosourceu2014Appln Componentu2014InfoObju2014right clickmaintain master data
Click execute
You can see the data load
Hope this helps!!! -
Output report data to excel file format or csv format
Is there any way to save softcopy of report output to excel file format or csv format.
Hi,
Regarding csv file format, i have no issues. The file is generating without any issues in using oracle reports without using any PL/SQL code.
My requirement is to design oracle reports to generate excel (.xls) file with multiple worksheets. Each sheets are having many data and graphs(chart).
Using oracle reports alone, how to achieve this.
In oracle reports 10g 1.2.0 version, I tried by creating .rdf file but, it is generating single worksheet only.
In oracle reports 10g 1.2.0 ver, I tried by creating .jsp file. For this first i am creating excel template about how my ouput column headings all that going to be with one sample hard coded data and save the excel file as web page.
Eg employee.html.
Next open the html file in oracle reports builder and double click the websource now, you will see the jsp tags, html and xml tags. Now include the contentType="application/vnd.ms-excel " and charset also.
Next, include the <rw:foreach id="G_EMPNO_1" src="G_EMPNO">
here insert the fieldl for each column by removing the hard coded values.
close the tag
</rw:foreach>
Save the file as .jsp and deploy it in oc4 enabled folder (say, devsuite_home/reports/j2ee/reports_ids/web
Start the oc4J server
Run it in the browser http://server:port/reports/emp.jsp?useride=uid/pwd@db
It is invoking the Microsoft excel with 3 sheets default and my emp table output in the first page.
We can save this output file as .xls file by clicking file -> save as.
1) The question is, it is working fine with Microsoft excel 97-2003 version. But for excel 2007, i am not able to create single html file like how 2003 save web page option.
2) I found this in oracle getting started demo
http://www.oracle.com/technology/products/reports/htdocs/getstart/demonstrations/index.html
Which is more useful. This is what i am looking for.
I done that in excel 2003 as per demo. But excel 2007 with reports 10g issues.
Is there any demo for 10g with excel 2007
3) For most of excel issues working fine with excel 2003 and 10g. But excel 2007 with 10g reports are issues.
I want the excel output from oracle reports with multiple worksheet similar to the above demo.
Thank you. -
Deleting/removing offline PDF files in the iPad Adobe Reader app
Whenever I open a file from the Acrobat.com cloud in the iPad's Adobe Reader app, a local copy is saved which I can read even when not connected to the internet. This is intentional by Adobe, and allows me to read PDFs offline, which is great. My question is, if an offline copy of every PDF I open is saved on the iPad, it will soon run out of disk space. Is there any way that I can delete/remove a specific offline PDF in order to free up disk space? I understand that this would mean that I would not be able to read that file offline anymore until I reconnect to the Acrobat.com cloud and reopen the document from the cloud. Thanks!
Hi,
Thank you for reproting the issue. You are right Adobe Reader saves a local copy whenever you opens a file from Acrobat.com. But there is a limitaion to the number of files it saves locally. So whenever the number of files opened from Acrobat.com reaches that value, it removes the first file opened from acrobat.com from its local memory and so on. So there is no chance of running out of memory.
Secondly, if you want to remove the locally saved files then you can just sign out from Acrobat.com and sign in again. In this case it will remove all the files saved locally. Then you have to download them again to view.
Hope this helps.
Thanks,
Ankit -
Hi,
I need help me to generate a report in csv format. I am using .rtf template and able to view HTML, PDF etc..
But for .csv format the report is blank.
Below is how my csv output should look, If possible please give a sample .rtf template or etext template to generate the below output..
R
R,SENDER,RECIPIENT,SEQUENCE NO,THRESHOLD,DATE AND TIME OF ANALYSIS,DATE AND TIME OF REPORT CREATION
R
H,xxxxx,zzzzz,02142004,100,20040701052407,20040701062407
R
R,IMSI,DATE FIRST EVENT,TIME FIRST EVENT,DATE LAST EVENT,TIME LAST EVENT,DC(HHHMMSS),NC,VOLUME,SDR
R
P,999990000000001,20040630,,20040630,,14408,43,12962331,178027
C,999990000000001,20040630,125959,20040630,235959,14221,33,,321904
R
R
R,IMSI,DATE FIRST EVENT,DATE LAST EVENT,DESTINATION OF EVENTS,NC,DC(HHHMMSS),SDR
A,999990000000001,20040630,20040630,+39,3,60115,73027
A,999990000000001,20040630,20040630,+34,10,50000,100000
R
R,END OF REPORT
T,22
Since I was not able to generate csv report using .rtf template , I tried using etext template and it worked little bit...
Can you also let me know how to add column headers like above in etext template..
Thanks,
ShivaHi,
Remove HTML from select.
Add this to page HTML header
<style>
#apexir_PARTY_NAME{width:260px!important}
</style>Br,Jari
Edited by: jarola on Jan 21, 2010 9:32 AM
Code corrected -
Delete extra spaces in table column
hi how can i delete extra spaces in table column for example if table column value is store as 'ÄAAAAA ' how can i delete that extra space
this is the column i what to delete extra spaces
select SUBTYPES from tablesubtype;am in
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
PL/SQL Release 11.2.0.3.0 - Production
CORE 11.2.0.3.0 Production
TNS for Solaris: Version 11.2.0.3.0 - Production
NLSRTL Version 11.2.0.3.0 - Production
Edited by: adf0994 on 2012/12/03 11:30 AM
Edited by: adf0994 on 2012/12/03 11:42 AMUPDATE tablesubtype
SET SUBTYPES = TRIM (SUBTYPES);Doing RTRIM alone will not suffice coz it'll only remove Right Spaces and NOT Left ones.
I guess, in your case doing a TRIM will be more beneficial to be safe and prevent any left spaces in future.
For intermediate spaces... try this.
UPDATE tablesubtype
SET SUBTYPES = REGEXP_REPLACE (SUBTYPES, ' ', '');Hope this Helps,
Ranit B.
Edited by: ranit B on Dec 3, 2012 2:33 PM
-- added regexp -
Remove spaces and special characters from a form field
Hi,
I am tragically new to all of this, but am trying to create a form in Adobe Acrobat 9. I am trying to use a Custom Format script to take inputs in a form field and automatically remove spaces and special characters (hyphens specifically). For example, if a user inputs "RAN-99 06" I would like it to change to "RAN9906." I found this script that will not let users input special characters
if (!event.willCommit) {
event.change = event.change.replace(/[\$#~%\*\*\^\-\(\)\+=\[\]\{\};\"\<\>\?\|\\\!]/g, "");
And that's okay, but I can't figure out how to disallow spaces. Also, the perference would be for a script to allow users to input the data as they like, but to clean it up after they leave the text field.
Thanks in advance!From the description, I assume that the script is currently in the Keystroke event. In fact, that would be a most logical way to have it; simply ignore anything unwanted when entered.
If you want to allow the user to enter anything, but "clean it up" when done, you would place your code in the Validate event. You will have to adjust your Regular Expression so that it works globally, but that's the whole difference. This will change the value.
Note that you can also enter the code into the Format event. However, that would only change the visual representation of the value, but internally, the value would remain as entered.
Hope this can help.
Max Wyss. -
How to remove spaces present in one of the records in a table
Hi
i have a requirement where i need to delete the spaces present in one of the columns in a table.The table has a column with the data in the form of lastname,firstname.The old data present there has one space between the lastname and the firstname and the new data has no space between the last and the first names.so i need to come out with something that will remove the space between the last and firstname in the old records.
Can you give me some suggestions?Maybe something like this?
SQL> WITH data AS
2 (
3 SELECT 'Oracle,Corporation' lastnamefirstname
4 FROM dual
5 )
6 SELECT REPLACE(lastnamefirstname,',',NULL)
7 FROM data ;
REPLACE(LASTNAMEF
OracleCorporation
1 row selected. -
Leading zero getting truncated in .CSV format GUI_DOWNLOAD
Hello experts,
I am trying to download the data using GUI_DOWNLOAD in .CSV format but the leading zeros are getting truncated. For instance Company code 0001 is displayed as 1 in the CSV File. But when I open the same file in notepad I am seeing 0001. Is this a known issue or this is how .CSV format should be?
I have gone through some threads in SDN but they are not helpful.
Your expert advise is much appreaciated.
Thanks
Abdul HakimThat is how excel displays values like 0001. It interprets them as a number and removes leading zeros.
If you don't want this happen and you want excel to treat them like text, you need to append a quote at the beginning of the token like '0001
You can use concatenate like below to append a single leading quote
field = '0001'.
CONCATENATE '''' field INTO field. -
'SHIFT variable RIGHT deleting trailing space' not working
I have a character field in a transaction that occasionally gets populated with a value that has a space at the end or at the beginning or both. This is causing the dataload to fail. I added code below to remove these spaces from the end and beginning-
SHIFT <variable> RIGHT deleting TRAILING space.
SHIFT <variable> LEFT deleting LEADING space.
The SHIFT LEFT works perfectly and deletes the space at the begining of the value but SHIFT RIGHT does not delete the space at the end for some reason. I tried defining the variable as a char (16), string but nothing seems to make it work.
Note: I cannot use CONDENSE because the value can have spaces in between that we cannot delete.
Any ideas why shift right wouldn't work?Hi Maanasa,
First of all Shift works only with string datatype. So transfer the contents of that character field into a string datatype and do the shift operation.
Declare a string variable of that type. Data v_str type string.
Pass the contents of the character field into the string.
And do the shift operation on the string and pass the value of the string back to the character field.
Shift v_str by 1 places right.
Please try this.
Thanking you,
Jerry -
Sorry for asking a very simple (hopefully) question. Does anyone know how can remove spaces from a given field. One of my field has the following:
field1 = ' ABCD'.
What command should I use so field1 would end up with just 'ABCD'?
Thanks.Hi SS
General templates for doing such operations on strings:
SHIFT <c> LEFT DELETING LEADING <str>.
SHIFT <c> RIGHT DELETING TRAILING <str>.
where str can be SPACE or something like e.g: 'abc'
Regards
Ashish
Maybe you are looking for
-
Semi-opaque background rectangle for subtitles
There should be a simple answer for this, but can't seem to find it after hours combing through the archives. I want to have subtitles for a documentary using FCP HD (no plug-ins) and have succeeded creating the text. But I want a transluscent box in
-
Problem i'm facing while trying to open the form builder
Hi all, I'm facing a small problem while i'm trying to open the form builder via Portal - content management - form builder, i.e., intially a dialogue box statting that : Applet(s) in this HTML page requires a version of java different from the one t
-
Mighty Mouse causing keyboard problems?
I just recently bought a wireless Mighty Mouse, and, after having installed it, all of my F buttons (dim screen, brighten screen, expose, dashboard, etc.) on my MacBook's keyboard are incorrect. My forward one track button is now the expose, and my v
-
Lenovo B310 (core i3-550) - loud fan and disk noise
I got my B310 delivered today and happy with overall look and feel. Just after few our of running, can hear loud noise. Just double checked and found its cooling fan and hard disk making noise. I am bit worried about this and looking for any possible
-
Has anyone had a positive Ovi experience?
Has anyone had a positive Ovi experience, particularly when dealing with support. I've tried twice now. The first time it took two weeks and many emails before I got my application. This time, again after two weeks, they sent the wrong application ve