TextArea in Applet to CSV file
Hi All,
I was wondering if it is possible to save the content of a TextArea in a CSV file? If so please let me know the command that does this job!
Thanks,
ng.
There is no command for that. You have to get the text and write it to a file with commas inserted in between. How you need to do it depends on your application requirements. If you need more information, the Java tutorial and API docs are good enough.
Similar Messages
-
To show the result of 2 grids in a single csv file
Hi,
i want to show 2 grids(seperately) in a csv file.i created a aggregate query that is giving me result of 2 grid seperately but when i use a igrid template with aggregate query it is giving me result in a single row.i.e instead of giving 2 grids it is giving result with all the columns in a single row .I am using Applet.saveas CSV File();is there any way to have 2 seperate grid in a single Excel file.
thanks in advance.Karthik
Aggregate Query is mostly used to combine multiple queries which have at least one common column among those.
For ur requirement, u can use direct BLS with the help of Action Block <b>WriteFile</b>.
<b>Scenario :</b> u hv 2 queries - one with 4 columns A, B, C & D; another with 2 columns E & F
U want to display those tables separately in one single Excel Sheet.
<b>Solution :</b> Forget AggregateQuery and Take the following steps
Step 1: Take those two Queries in one sequence
Step 2: Define two Local variables - Text1 & Text2 with String Data Type
Step 3: Use Repeater to loop one query's result and Assign the Looping results to the Local.Text1 using action <b>Assignment</b> as following expression in the Link Editor
<b>Local.Text1 &
Repeater_0.Output{/Row/A} & tab &
Repeater_0.Output{/Row/B} & tab &
Repeater_0.Output{/Row/C} & tab &
Repeater_0.Output{/Row/D} & crlf
</b>
Step 4: Use another Repeater outside the first Repeater to loop 2nd query's result and Assign the looping results to the Local.Text2 in similarly way as follows in the Link Editor
<b>
Local.Text2 &
Repeater_1.Output{/Row/E} & tab &
Repeater_1.Output{/Row/F} & crlf
</b>
Step 5: Use action <b>WriteFile</b> outside those above Repeaters and take the mode <b>APPEND</b> and FilePath <b>C:
test
TwoTables.xls</b> and Text as follows
<b>
"A" & tab & "B" & tab & "C" & tab & "D" & crlf & Local.Text1 & crlf & crlf &
"E" & tab & "F" & crlf & Local.Text2
</b>
in the Link Editor
Step 6: Hit F5/F6 and see the Excel File with two tables showing separately in the mentioned path above.
Regards
Som -
Getting a csv file in server from client
Hi,
This is my first mail to the forum. I hope some one would help me to find a solution for me. I got a xyz . csv file in my server. I want to get that file and save it in my client (anywhere)having the same file type. Gimme source code if you have. I am looking for a solution for the past two days.
please reply me as soon as possible.
To be more clear, I am having a save button in my page.On clicking this button i should fetch the file from server and save it in my desired location as a file itself not as text content or anything.
Please help me
Thanks in regards,
S.karthikYou can open the textfile on the servlet and then send the information to the client (applet) as stirngs. The must then applet convert the stirngs into some object or simply display the information in someway. But then the text file that you are opening must be stored in some relevant tomcat directory e.g. on the server. If you want to open a file on the clients computer, you get into signed applets.
-
How can i update an existing item in sap using CSV file?
Hi,
i am trying to update an existing Item in SAP using a CSV file.
in the message log i get an error message that the item already exists.
what should i do in order to update the existing record?
Thanks, UdiHi..........
I would sugest you to use Tab delimited file and choose proper option in order to update the itsm master in DTW......
Regards,
Rahul -
Loading 361000 records at a time from csv file
Hi,
One of my collegue loaded 361000 records from one file file , how is this possible as excel accepts 65536 records in one file
and even in the infopackage the following are selected what does this mean
Data Separator ;
Escape Sign "
Separator for Thousands .
Character Used for Decimal Point ,
Pls let me knowhi Maya,
it just possible, other than ms-excel, we have editor like Textpad that support more 65k rows (and windows Notepad), the file may be generated by program or edited outside in excel, or newer version of excel is used, ms-excel 2007 support more 1 million rows.
e.g we have csv file
customer;product;quantity;revenue
a;x;"1.250,25";200
b;y;"5.5";300
data separator ;
- char/delimeter used to separate field, e.g
escape sign, e.g
- "1.250,25";200 then quantity = 1.250,25
separator for thousands = .
- 1.250,25 means one thousand two hundred ...
char used for decimal point
- - 1.250<b>,</b>25
check
http://help.sap.com/saphelp_nw70/helpdata/en/80/1a6581e07211d2acb80000e829fbfe/frameset.htm
http://help.sap.com/saphelp_nw70/helpdata/en/c2/678e3bee3c9979e10000000a11402f/frameset.htm
hope this helps. -
Error while creating table from csv file
I am getting an error while creating a table using 'Import Data' button for a csv file containing 22 columns and 8 rows. For primary key, I am using an existing column 'Line' and 'Not generated' options.
ORA-20001: Excel load run ddl error: drop table "RESTORE" ORA-00942: table or view does not exist ORA-20001: Excel load run ddl error: create table "RESTORE" ( "LINE" NUMBER, "PHASE" VARCHAR2(30), "RDC_MEDIA_ID" VARCHAR2(30), "CLIENT_MEDIA_LABEL" VARCHAR2(30), "MEDIA_TYPE" VARCHAR2(30), "SIZE_GB" NUMBER, "RDC_IMG_HD_A" NUMBER, "START_TECH" VARCHAR2(30), "CREATE_DATE" VARCHAR2(30), "RDC_MEDIA_DEST" VARCHAR2(30), "POD" NUMBER, "TAPE" NUMBER, "ERRORS_YN" VA
Any idea?I am getting an error while creating a table using 'Import Data' button for a csv file containing 22 columns and 8 rows. For primary key, I am using an existing column 'Line' and 'Not generated' options.
ORA-20001: Excel load run ddl error: drop table "RESTORE" ORA-00942: table or view does not exist ORA-20001: Excel load run ddl error: create table "RESTORE" ( "LINE" NUMBER, "PHASE" VARCHAR2(30), "RDC_MEDIA_ID" VARCHAR2(30), "CLIENT_MEDIA_LABEL" VARCHAR2(30), "MEDIA_TYPE" VARCHAR2(30), "SIZE_GB" NUMBER, "RDC_IMG_HD_A" NUMBER, "START_TECH" VARCHAR2(30), "CREATE_DATE" VARCHAR2(30), "RDC_MEDIA_DEST" VARCHAR2(30), "POD" NUMBER, "TAPE" NUMBER, "ERRORS_YN" VA
Any idea? -
Error while refreshing a report using local csv file
Hi,
I'm using BI 4.1 SP02.
While using Rich client, I've created a report with some merged queries, while one of the queries is a local CSV file - saved on AD in some server, and not on the repository inside BO.
While trying to refresh the report with the Rich client, it all went great.
Now, while using BI Launchpad java based app, I can't refresh the report - I get the following error:
"An Internal error occurred while calling 'processDPCommandsEx' API. (Error: ERR_WIS_30270) (WIS 30270)"
Should I be able to refresh a report without the Rich if it contains a local file (which is possible to EDIT only with rich) ?
If so, then did someone ran into this error?
Thank you,
Or.First of all, thanks for both of the replies.
Second,
my problem is unlikely have to do something with permissions from one reasons -
when the report is using XLS\XLSX on same folder(with same name prefix) - the report is running without any problem.
Only problem is while refreshing without Rich while the source is network CSV file.
Any suggestions?
Thanks. -
Issue in conversion of output file from alv to csv file using GUI_DOWNLOAD
hi,
I am using GUI_DOWNLOAD to convert the internal table that am getting as the output of an alv into a csv(comma separated file) file.I am using the following code but its not generating a csv file instead it is generating a normal space delimited file.
The code is as follows:
data : lv_fname type string.
lv_fname = 'C:\Users\pratyusha_tripathi\Desktop\status8.csv'. " Provide the file path & file name with CSV extention
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
filename = lv_fname " File name including path, give CSV as extention of the file
FILETYPE = 'DAT'
WRITE_FIELD_SEPARATOR = '#' " Provide comma as separator
tables
data_tab = ITAB " Pass the Output internal table
FIELDNAMES =
EXCEPTIONS
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.
Kindly let me know what changes can be made to make my code work.Also can GUI_download be used for batch processing and storing the output in application server?
Thanks ,
PratyushaHi,
the short text description for WRITE_FIELD_SEPARATOR is "Separate Columns by Tabs in Case of ASCII Download", so why do you expect a comma?
Try SAP_CONVERT_TO_CSV_FORMAT and then download.
And no, GUI_DOWNLOAD is only for download via SAP GUI to a users computer.
Best regards,
Oliver -
Creation of CSV file on client machine with data from forms
Hi,
My requirement is to generate a CSV file(or .XLS) on the client machine ie local drive with the details shown in a form.
Oracle version -
Oracle Database 11g Enterprise Edition Release 11.1.0.7.0 - 64bit Production
PL/SQL Release 11.1.0.7.0 - Production
CORE 11.1.0.7.0 Production
TNS for Solaris: Version 11.1.0.7.0 - Production
NLSRTL Version 11.1.0.7.0 - Production.
I have searched the web for last couple of days and got to know that TEXT_IO is to be used to generate files on client machine. However, when I tried TEXT_IO, it was not able to generate the file on client rather it was able to generate on database server. After further browsing on this, there was a link which said that we need to use CLIENT_TEXT_IO to generate file on client side. For this, i was required to subclass the webutil.pll which i did and corrected the code to use CLIENT_TEXT_IO. The form was unable to compile and was not able to find "webutil_core" package.
I am very confused with the disparity in the information available on the web as in what to use to generate a file on client side. If anyone has use it in the past, can he/she please detail what to use to get things sorted.
Thanks,
ROracle version - Oracle Database 11g Enterprise Edition Release 11.1.0.7.0 - 64bit Production
PL/SQL Release 11.1.0.7.0 - Production
CORE 11.1.0.7.0 Production
TNS for Solaris: Version 11.1.0.7.0 - Production
NLSRTL Version 11.1.0.7.0 - Production. >
So, what is your FORMS version. This is more important than your database version.
My requirement is to generate a CSV file(or .XLS) on the client machine ie local drive with the details shown in a form. Depending on your Forms version, you would use TEXT_IO (if Forms 6i running in Client/Server mode) or WebUtil (if Forms 9i or higher).
I'm going to guess that you are at least using Oracle Forms 9i since you stated that your attempt at using TEXT_IO produced a file on the DB server.
There is more to using WebUtil than just attaching the WEBUTIL.PLL. If you had performed a simple search of the Forms Help System would have found numerous WebUtil topics to include: Introduction to WebUtil, Configuring WebUtil, Using WebUtil in Your Applications and the WebUtil User's Guide. If you have Oracle Forms release 10g or higher, WebUtil is included when you installed Forms, however, you do need to configure your installation to use WebUtil and you must download the Java COM Bridge (jacob.jar) from Source Forge. Take a look at the Configuring WebUtil Forms Help topic to find out which version of the Java COM Bridge you will need to download.
After you have successfully configured WebUtil, take a look at the Using WebUtil in Your Applications topic to find out how to implement WebUtil in a form.
Searching the Internet for answers is great, but don't forget the look at the Forms Help System because the majority of your questions can be answered there. :)
Lastly, configuration of WebUtil is primarily done on your Application Server (AS). However, if you plan to perform preliminary runtime testing by running your Form from the Forms Builder, then you will configure your local runtime to support WebUtil as well as configure your AS. The steps are exactly the same. A common mis-step is to skip a step during the configuration because you don't think the step applies. Take a look at the Forms Help Runtime Setup Checklist topic for a list of step you need to complete in order to enable WebUtil.
Hope this helps,
Craig B-)
If someone's response is helpful or correct, please mark it accordingly. -
Sender "Mail" adapter - CSV file attachment
Hi there
I'm looking for some help in configuring a sender mail adapter that receives ".csv" files. I did read some blogs that mention using the "PayloadSwapBean" module to read the mail attachment instead of the mail content. My problem is to now convert the ".csv" file into a message. Is there a module that I can use ( is it the "MessageTransfomBean" ) and how. Any help would be appreciated.
Thanks
SalilHi Salil,
If you want to send a mail with a body and attachments, the message sender HAS to provide an XI message with attachments. I doubt a CSV file does justice.
As Renjith said you need to convert CSV to XmL.
A short description about the Standard Modules:
MessageTransformationBean is a standard module used to apply the XSLT mapping to the adapter module by using <i>Transform.class</i> ( This xslt mapping is done to create a mail package, Dont confuse with the actual mapping in your case this is NOT for converting csv to xml).
Also this module can be used to change the name and type of payloads by using <i>Transform.contentType</i>, <i>Transform.contentDisposition</i>, <i>Transform.contentDescription</i>.
PayloadSwapbean is a standard module for replacing payloads with other payloads (SWAP)
If you want to give each attachment a certain name use Parameters, <i>swap.keyname</i> for name of the payload and <i>swap.keyvalue</i>.
I Hope the use of standard modules is understood. -
Read a CSV file and dynamically generate the insert
I have a requirement where there are multiple csv's which needs to be exported to a sql table. So far, I am able to read the csv file and generate the insert statement dynamically for selected columns however, the insert statement when passed as a parameter
to the $cmd.CommandText
does not evaluate the values
How to evaluate the string in powershell
Import-Csv -Path $FileName.FullName | % {
# Insert statement.
$insert = "INSERT INTO $Tablename ($ReqColumns) Values ('"
$valCols='';
$DataCols='';
$lists = $ReqColumns.split(",");
foreach($l in $lists)
$valCols= $valCols + '$($_.'+$l+')'','''
#Generate the values statement
$DataCols=($DataCols+$valCols+')').replace(",')","");
$insertStr =@("INSERT INTO $Tablename ($ReqColumns) Values ('$($DataCols))")
#The above statement generate the following insert statement
#INSERT INTO TMP_APPLE_EXPORT (PRODUCT_ID,QTY_SOLD,QTY_AVAILABLE) Values (' $($_.PRODUCT_ID)','$($_.QTY_SOLD)','$($_.QTY_AVAILABLE)' )
$cmd.CommandText = $insertStr #does not evaluate the values
#If the same statement is passed as below then it execute successfully
#$cmd.CommandText = "INSERT INTO TMP_APL_EXPORT (PRODUCT_ID,QTY_SOLD,QTY_AVAILABLE) Values (' $($_.PRODUCT_ID)','$($_.QTY_SOLD)','$($_.QTY_AVAILABLE)' )"
#Execute Query
$cmd.ExecuteNonQuery() | Out-Null
jyeragiHi Jyeragi,
To convert the data to the SQL table format, please try this function out-sql:
out-sql Powershell function - export pipeline contents to a new SQL Server table
If I have any misunderstanding, please let me know.
If you have any feedback on our support, please click here.
Best Regards,
Anna
TechNet Community Support -
Not able to write image in csv file
I have tried to write JPEG file in csv but having a critical probem.
The JPEG in the CSV is coming wrongly. Means whenever I open the created CSV file I can see the image has been moved upside down.
Can any one please help me how to write a proper image using ClientAnchor?
Can anyone please provide any sample code
Edited by: 837718 on Feb 17, 2011 6:25 PMTry this
Workbook workBookObject= new HSSFWorkbook();
Sheet sheet = wb.createSheet();
CreationHelper helper = wb.getCreationHelper();
Drawing drawing = sheet.createDrawingPatriarch();
ByteArrayOutputStream img_bytes = new ByteArrayOutputStream();
int b;
while ((b = fis.read()) != -1)
img_bytes.write(b);
fis.close();
helper = workBookObject.getCreationHelper();
ClientAnchor anchor = helper.createClientAnchor();
int picIndex = workBookObject.addPicture(img_bytes.toByteArray(),Workbook.PICTURE_TYPE_JPEG);
anchor.setCol1(col);
anchor.setRow1(0);
anchor.setAnchorType(ClientAnchor.MOVE_DONT_RESIZE);
pic = drawing.createPicture(anchor, picIndex);
pic.resize(); -
Hello All,
I have a simple scenerio IDOC to File.
We had a requirement of making a XML file of IDOC received in PI , ery simple and straight forward.
Now Target side as a requirement to place a file in CSV format.
I mean the IDOC received in PI should be placed in target directory as CSV file.
I am working on PI7.11 , can anyone help me with some info.
Thanks a lot in advance.
Regards,
VikrantHi Vikrant,
>>Now Target side as a requirement to place a file in CSV format. I mean the IDOC received in PI should be placed in target directory as CSV file.
If you want the XMLized IDoc to be converted to a plain IDoc, either use the approach suggested by Michal in this blog (use tunneling and create a by-pass scenario)
/people/michal.krawczyk2/blog/2005/11/21/xi-idoc-to-idoc-tunneling--how-fast-and-easy-can-you-get
or
download the IDoc as a flat Idoc and use PI to transfer the content from one directory to another.
PS: All this is applicable if you want the Flat version of XMLized Idoc
Regards
Suraj -
Creating a CSV file from a pl/sql procedure
Hi Everyone,
I would like to know how to write a procedure in pl/sql where i need to check if they are any records in a table say "Table A".
If they are any records in the "Table A" then we need to write those records in the "Table A" to the CSV file.
If they are no records then we need to insert a record into the CSV file that "No records are found in "Table A".
Could anybody please help ?
Thanks in advancesee this
ops$tkyte@8i> create or replace procedure dump_table_to_csv( p_tname in varchar2,
2 p_dir in varchar2,
3 p_filename in varchar2 )
4 is
5 l_output utl_file.file_type;
6 l_theCursor integer default dbms_sql.open_cursor;
7 l_columnValue varchar2(4000);
8 l_status integer;
9 l_query varchar2(1000)
10 default 'select * from ' || p_tname;
11 l_colCnt number := 0;
12 l_separator varchar2(1);
13 l_descTbl dbms_sql.desc_tab;
14 begin
15 l_output := utl_file.fopen( p_dir, p_filename, 'w' );
16 execute immediate 'alter session set nls_date_format=''dd-mon-yyyy hh24:mi:ss''
17
18 dbms_sql.parse( l_theCursor, l_query, dbms_sql.native );
19 dbms_sql.describe_columns( l_theCursor, l_colCnt, l_descTbl );
20
21 for i in 1 .. l_colCnt loop
22 utl_file.put( l_output, l_separator || '"' || l_descTbl(i).col_name || '"'
23 dbms_sql.define_column( l_theCursor, i, l_columnValue, 4000 );
24 l_separator := ',';
25 end loop;
26 utl_file.new_line( l_output );
27
28 l_status := dbms_sql.execute(l_theCursor);
29
30 while ( dbms_sql.fetch_rows(l_theCursor) > 0 ) loop
31 l_separator := '';
32 for i in 1 .. l_colCnt loop
33 dbms_sql.column_value( l_theCursor, i, l_columnValue );
34 utl_file.put( l_output, l_separator || l_columnValue );
35 l_separator := ',';
36 end loop;
37 utl_file.new_line( l_output );
38 end loop;
39 dbms_sql.close_cursor(l_theCursor);
40 utl_file.fclose( l_output );
41
42 execute immediate 'alter session set nls_date_format=''dd-MON-yy'' ';
43 exception
44 when others then
45 execute immediate 'alter session set nls_date_format=''dd-MON-yy'' ';
46 raise;
47 end;
48 /
Procedure created.
ops$tkyte@8i> exec dump_table_to_csv( 'emp', '/tmp', 'tkyte.emp' );
PL/SQL procedure successfully completed. -
How can I make an easy *.CSV file to load into database table
Hi All,
I have a huge excel sheet having columns item#, description and qty. The description column sometimes maybe one word name, two word name separated with space or may be , spearated name. I want to write and PL/SQl code which will read this file and load it into database table. Now the *.CSV file is either comma delimited or tab text delmited which both do not solve my issue. Is there any better solution with anyone which can prevent the manual editing to the *.CSV file and I can easily load it to table.
Your help is appreciated,
Thanks
ZahirSQL*Loader is probably the fastest method, but since you specifically asked for a PL/SQL method:
http://asktom.oracle.com/pls/ask/f?p=4950:8:::::F4950_P8_DISPLAYID:464420312302
Maybe you are looking for
-
Test a file to fle scenario using NFS in 7.1
Hi Experts, I have one small confusion... when testing a file to file scenario in PI 7.1 using NFS...im wondering what path should i specify for the source directory? cos earlier in 7.0, i would have given /usr/sap.... but now i dont think 7.1 has vi
-
FCPX choppy slow motion, picture quality and effects
is it just me or does final cut pro x have really bad quality picture. two main things i have noticed in using this software is the slow motion is really choppy even after rendering out with optical flow and there is a lot of vibration in the picture
-
Hi Guys, I work on 6.0 system. I make return delivery using T_code MBRL. When I set indicator in field "Create Delivery" system doesn't let me save dokument. I get message "Data for creating delivery is incomplite (Sales Org.)" I checked data like:
-
I am not able to open my mail appicaton?
i am not able to open my mail application. i am getting an error if i open my mail.....
-
Multiple Numeric Limit Test Names
How do I get the names of the Measurements of Multiple Numeric Limit from inside the VI that is doing the test. I wish to edit them to reflect the measurement that I am making. I can find and change the name of the step, but can't see where the name