To read xls file content
Hi all
I want read the content of a xls file.
For creating xls file am used poi.
On reading xls hoe to get the column and row count.
pls reply with example
thanks for reply.
You're already using POI to create XLS files. Guess what, you can also use the same to read XLS files. If your problem is more that you don't know how, then just read the documentation and code examples which come along it (and are available at its homepage).
Similar Messages
-
How to read .xls file from FTP server t oInternal table
Hi
am using the FTP_SERVER_TO_R3 to read xls file from FTP server to internal table
but the data i get in LT_TEXT is special characters.
CALL FUNCTION 'FTP_SERVER_TO_R3'
EXPORTING
handle = hdl
fname = f_name "ProdDataFromCRM.xls.
* CHARACTER_MODE = 'X'
* IMPORTING
* BLOB_LENGTH =
TABLES
BLOB = lt_text
* TEXT = lt_text
EXCEPTIONS
TCPIP_ERROR = 1
COMMAND_ERROR = 2
DATA_ERROR = 3
OTHERS = 4
can any one help me out to get the exact data..
Really appreciate your quick response..
Thank YouHi, if you really retrieve an excel file, you can not see the data in ABAP. You may see them in Excel. For this you may use
CALL METHOD document->open_document_from_table
of the interface i_oi_document_proxy for OLE objects. You can access the data with reference to the interface i_oi_spreadsheet.
Please check [Desktop Office Integration (BC-CI)|http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCCIOFFI/BCCIOFFI.pdf] for details.
But, who knows, perhaps you want "And Now For Something Completely Different".
Regards
Clemens -
How to read text file content in portal application?
Hi,
How do we read text file content in portal application?
Can anyone forward the code to do do?
Regards,
AnaghaCheck the code below. This help you to know how to read the text file content line by line. You can display as you require.
IUser user = WPUMFactory.getServiceUserFactory().getServiceUser("cmadmin_service");
IResourceContext resourceContext = new ResourceContext(user);
String filePath = "/documents/....";
RID rid = RID.getRID(filePath);
IResource resource = ResourceFactory.getInstance().getResource(rid,resourceContext);
InputStream inputStream = resource.getContent().getInputStream();
BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream));
String line = reader.readLine();
while(line!=null) {
line = reader.readLine();
//You can append in string buffer to get file content as string object//
Regards,
Yoga -
Need to read text file content and have to display it in multiline text box
dear all,
Need to read text file content and have to display it in multiline text box.
actually im new to file handling. i have tried up to get_line and put_line.
in_file := TEXT_IO.FOPEN ('D:\SAMPLE.txt', 'r');
TEXT_IO.GET_LINE (in_file,linebuf);
i dont know how to assign this get_line function to text item
pls help me in this regards,Simply write:
in_file := TEXT_IO.FOPEN ('D:\SAMPLE.txt', 'r');
TEXT_IO.GET_LINE (in_file,linebuf);
:block2.t1 := chr(10)||:block2.t1||chr(10)||linebuf;
chr(10) --> is for new line character -
How to read trace file content
Hi,
DB :11.2
How to read trace file content.It's only for ORACLE SUPPORT?
calling
call
entry
argument values in hex
location
type
point
(? means dubious value)
ksedst()+31
call
ksedst1()
000000000 ? 000000001 ?
7FFF19B98CA0 ? 7FFF19B98D00 ?
7FFF19B98C40 ? 000000000 ?
ksedmp()+610
call
ksedst()
000000000 ? 000000001 ?
7FFF19B98CA0 ? 7FFF19B98D00 ?
7FFF19B98C40 ? 000000000 ?
ksfdmp()+21
call
ksedmp()
000000003 ? 000000001 ?
7FFF19B98CA0 ? 7FFF19B98D00 ?
7FFF19B98C40 ? 000000000 ?
kgerinv()+161
call
ksfdmp()
000000003 ? 000000001 ?
7FFF19B98CA0 ? 7FFF19B98D00 ?
7FFF19B98C40 ? 000000000 ?
kgeasnmierr()+163
call
kgerinv()
0069107E0 ? 011F80370 ?
7FFF19B98D00 ? 7FFF19B98C40 ?
000000000 ? 000000000 ?
kssmov()+502
call
kgeasnmierr()
0069107E0 ? 011F80370 ?
7FFF19B98D00 ? 7FFF19B98C40 ?
000000029 ? 0D3F1C600 ?
kfncInitSlavePool() call
kssmov()
0D3F1C5D0 ? 000000000 ?
+203
7FFF19B98D00 ? 7FFF19B98C40 ?
000000029 ? 0D3F1C600 ?
kfncWorkMsgAlloc()+ call
kfncInitSlavePool() 0D3F1C5D0 ? 000000000 ?
83
7FFF19B98D00 ? 7FFF19B98C40 ?
000000029 ? 0D3F1C600 ?
kfncFileUnidentify( call
kfncWorkMsgAlloc() 0D3F1C5D0 ? 7FFF19B99AD0 ?
)+635
7FFF19B98D00 ? 7FFF19B98C40 ?
000000029 ? 0D3F1C600 ?
kffmRequestFree()+1 call
kfncFileUnidentify( 7FFF19B99BC8 ? 7FFF19B99BC0 ?
Br,
RajOne needs to know the meaning of the kernel functions and their working within the oracle database. I guess, oracle support can do the analysis more easily as they have access to the software code as well necessary tools to interpret these internal routines.
Aman.... -
How to read entire file content in one XML tag?
Hi,
How can I read entire file content in one XML tag?
What specifications do I need to specify in Sender adapter?
regards,
Anirudh.Hi Chirag,
I am reading a flat file for File to Idoc scenario.
Target Idoc is nested which can not be populated with graphical mapping.
see below post for more detail.
[Mapping flat XML to nested IDOC using node functions |Mapping flat XML to nested IDOC using node functions;
The problem here is I'm not able to identify when to insert context change for child which is repeating for a repeating parent.
Solution therefore, I think is reading entire flat structure in one node and then use UDF to populated intermediate target with proper nesting.
Thats why I need to read entire XML.
regards,
Anirudh. -
I'm trying to read a XLS file from a URL.
What exactly the code is trying to do is this:
User clicks on a button in a webpage for select a xls file . The file selected may be read and a method write a txt file on another server.
How can i do this?
Many thanks.Hi,
Check whether path ur providing to the open data set stmt is correct or not in debugging mode.
* File upload to internal table from UNIX Directory
IF NOT p_i1file IS INITIAL AND NOT p_path IS INITIAL.
CONCATENATE p_path p_i1file INTO v_file.
CONDENSE v_file.
OPEN DATASET v_file FOR INPUT IN TEXT MODE MESSAGE v_msg.
IF sy-subrc EQ 0.
WRITE: / 'INPUT FILE CONTAINS NO RECORD :'(010), v_file.
DO.
CLEAR tbl_input.
READ DATASET v_file INTO tbl_input.
IF sy-subrc NE 0.
EXIT.
ELSE.
APPEND tbl_input.
ENDIF.
ENDDO.
* Close Input File
CLOSE DATASET v_file.
ELSE.
WRITE:/'Error uploading file: '(008),v_file.
STOP.
ENDIF.
ENDIF.
It should work.check the sy-subrc value and file value in debug mode.
Thanks
Parvathi -
Problem reading .xls file from App Server
Hi Everyone......
I hope this might be a common problem but i searched for similar problem......i did'nt find the solution my problem is
I'm trying to download .xls(excel file data into an internal table using OPEN DATASET FOR INPUT IN TEXT MODE ENCODING DEFUALT and read dataset for reading it).But in the read dataset syntax all stange values like **$#@&&& are getting uploaded???? I dont now why......
Is it happing because i'm trying to upload .XLS file ???
My coding is as follows...........
OPEN DATASET p_file FOR INPUT IN TEXT MODE ENCODING DEFAULT.
IF sy-subrc NE 0.
IF sy-batch IS INITIAL.
MESSAGE i001(zz) WITH 'Error opening file for upload'.
EXIT.
ELSE.
MESSAGE s001(zz) WITH 'Error opening file for upload'.
EXIT.
ENDIF.
ENDIF.
*First Uploading the data into structure
DO.
READ DATASET p_file INTO l_wa_tab. "My internal table work area
IF sy-subrc = 0.
APPEND l_wa_tab TO l_tab.
ELSE.
EXIT.
ENDIF.
ADD 1 TO count.
ENDDO.
CLOSE DATASET p_file.
Any solution for above problem.........Hi,
Check whether path ur providing to the open data set stmt is correct or not in debugging mode.
* File upload to internal table from UNIX Directory
IF NOT p_i1file IS INITIAL AND NOT p_path IS INITIAL.
CONCATENATE p_path p_i1file INTO v_file.
CONDENSE v_file.
OPEN DATASET v_file FOR INPUT IN TEXT MODE MESSAGE v_msg.
IF sy-subrc EQ 0.
WRITE: / 'INPUT FILE CONTAINS NO RECORD :'(010), v_file.
DO.
CLEAR tbl_input.
READ DATASET v_file INTO tbl_input.
IF sy-subrc NE 0.
EXIT.
ELSE.
APPEND tbl_input.
ENDIF.
ENDDO.
* Close Input File
CLOSE DATASET v_file.
ELSE.
WRITE:/'Error uploading file: '(008),v_file.
STOP.
ENDIF.
ENDIF.
It should work.check the sy-subrc value and file value in debug mode.
Thanks
Parvathi -
How to read a file content from portal
Hi experts,
I have a file (xml or xlsx), which i have kept in D drive.
then using GUI_UPLOAD, i have read file content into internal table. then i am proceeding furthur.
but in real, my file will be in portal (means https:\\in.xyz.com\........\TEST.XML
in this case i can not use GUI_UPLOAD.
can any one suggest how can i achieve above. Thanks.
Regards,
Venkata PrasadHi venkata
try this code below
tables: znks_exceldb.
types: begin of wa_input,
emp_id type string,
name type string,
middle type string,
last_name type string,
address type string,
acc_num type string,
mobile type string,
end of wa_input.
data: gt_intern type kcde_intern.
data:gwa_intern type kcde_intern_struc.
data gt_input type table of wa_input.
data gwa_input like line of gt_input.
data it_tab type table of znks_exceldb.
data it_wa like line of it_tab.
constants c_seprator type c value ','.
parameters ex_file type localfile obligatory.
at selection-screen on value-request for ex_file.
call function 'F4_FILENAME'
* EXPORTING
* PROGRAM_NAME = SYST-CPROG
* DYNPRO_NUMBER = SYST-DYNNR
* FIELD_NAME = ' '
importing
file_name = ex_file.
start-of-selection.
perform readfile using ex_file.
perform insert.
perform display.
form readfile using ex_file type localfile.
data:lv_filename type rlgrap-filename.
data: lv_index type i.
field-symbols: <> type any.
lv_filename = ex_file.
call function 'KCD_CSV_FILE_TO_INTERN_CONVERT'
exporting
i_filename = lv_filename
i_separator = c_seprator
tables
e_intern = gt_intern
exceptions
upload_csv = 1
upload_filetype = 2
others = 3.
if sy-subrc <> 0.
* Implement suitable error handling here
endif.
loop at gt_intern into gwa_intern.
move gwa_intern-col to lv_index.
assign component lv_index of structure gwa_input to <>.
move:gwa_intern-value to <>.
at end of row.
append gwa_input to gt_input.
clear gwa_input.
endat.
endloop.
endform.
form insert.
loop at gt_input into gwa_input.
it_wa-emp_id = gwa_input-emp_id.
it_wa-name = gwa_input-name.
it_wa-middle = gwa_input-middle.
it_wa-last_name = gwa_input-last_name.
it_wa-address = gwa_input-address.
it_wa-mobile = gwa_input-mobile.
it_wa-acc_num = gwa_input-acc_num.
append it_wa to it_tab.
endloop.
insert znks_exceldb from table it_tab accepting duplicate keys.
endform.
form display.
loop at gt_input into gwa_input.
write :/ gwa_input-emp_id,
gwa_input-name,
gwa_input-middle,
gwa_input-last_name,
gwa_input-address,
gwa_input-mobile,
gwa_input-acc_num .
endloop.
endform.
Regards
Niraj Sinha -
[CS3 JS] Reading TXT file content into String
Hello,
I'm currently wanting to display a dialog box that has a dropdown menu containing all countries of the world.
I have an external txt file that contains a list of all countries.
I thought I would simply read-in the contents of the 'txt' file into a string and use it for displaying the list.
For example
i Instead of the usual:
> var myLandMenu = dropdowns.add({stringList:["A", "B"...], selectedIndex:0});
i I thought of doing something like:
> var myLandList = ....? HELP ?....
> var myLandMenu = dropdowns.add({stringList:myLandList, selectedIndex:0});
Is this the way to do it?
What would be the way to read in the text file content as a string?
Thanks in advance,
Lee> var myLandList = ....? HELP ?....
> var myLandMenu = dropdowns.add({stringList:myLandList, selectedIndex:0});
It's hard to tell from context, but myLandList needs to be an array of strings.
If the file has one element per line, this would be one way of handling the
conversion:
var file = File("~/countries.txt");
file.open("r");
var str = file.read();
file.close();
var myLandList = str.split(/[\r\n]+/);
And assuming that this is ScriptUI and not the older ID UI, the menu creation
would look more like:
var myLandMenu = dropdowns.add(bounds, myLandList);
myLandMenu.items[0].selected = true;
-X
for photoshop scripting solutions of all sorts
contact: [email protected] -
Read a file content and copy to another Diectory
I wanted to do the following
1-read a file from dir
2- read the content of the file
3- if the file contains zeros
exit from this file and go to read next file
else
do some calculations
i read a file and its contents and found zeros in the contents, so how can i say in the code to go to next file..
any help pleaseIt depends on your code, but most likely using "return":
//pseudo code
while(moreFiles) {
parseFile(file)
void parseFile(File file) {
while(moreContentToRead) {
if(foundZero) {
return;
} -
Why the simulation is not accepting the data iam trying to give.
Why Does the "Read Waveform From File.vi" Behave Differently in the Run-time Engine?
what is the solution for this.Can you explain please.Iam also adding the vi file and the excel file I'm using.
Regards
Bharath
Attachments:
bharath.vi 12 KB
distorted ip.xls 737 KBHi Dennis,
I tried the simualtion you are given.It is giving the waveform but a portion of it only showing. Any time only 1023 samples of data is coming. That too it is coming from 17111 to 18134.I tried to change all the axis and scaling even then it is not changing. I am attaching the text files with tabs inside the elements. Can you please explain me the reason or can you send me the spread sheet file you've given for the simulation.
Thanks
Bharath.
Attachments:
bharath_2.vi 14 KB
plot.docx 29 KB -
How to read a file content in a ordinary java program
Please help me is there is any method is available to read the content of the file.I am asking in pure java not in the servlets.Guys please help me.I got structed here
Reading a text file in the systems character encoding: use the class java.io.FileReader. You can wrap a BufferedReader around it to get better performance (and a simple way to read lines)
Reading a text file in another character encoding: use FileInputStream and convert it to a reader with:
InputStreamReader reader = new InputStreamReader(fileStream, encoding);
where encoding is the character encoding as a String (like "Cp850" or "UTF-16LE"). Again, you can wrap a BufferedReader around that reader.
Reading a binary file: open a FileInputStream to the file and just read the bytes from it. You can use BufferedInputStream for better performance and DataInputStream to get a simple way to read primitive types like double and char.
Please help me is there is any method is available to
read the content of the file.I am asking in pure java
not in the servlets.Guys please help me.I got structed
hereAren't servlets pure Java? -
How to read a file content for editing?
Now i am using FileInputStream to read its content by bytes. How do i read the content line by line as string so that i am able to do some editing using replace().
public String load() throws FileNotFoundException, IOException {
BufferedReader r = new BufferedReader(new FileReader(new File(this.getClass().getResource(filename).getPath())));
String s = r.readLine();
StringBuffer result = new StringBuffer();
while (s != null) {
result.append(s + "\n");
s = r.readLine();
r.close();
return result.toString(); -
Read a file content into Variable
Hi There,
I've a file in Unix and the content of it need to be assigned to an ODI variable. How can I do it?
Regards.
-BhavaniStep 1. ODI procedure .
Command on Target - Java bean shell.
import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
BufferedReader br = new BufferedReader(new FileReader("C:\\test.txt" ));
String strLine = br.readLine();Step 2
Create variable and add
SELECT '<@=strLine@>' from dual This particular code will read only first line and pass into variable.
Maybe you are looking for
-
My PC does not allow me to access Playbook files
When I connect my PB to my computer to transfer or manage document file and I click on the Z drive, I get the following message: Z:\ is not accessible Logon Failure: unknown user name or bad password How do I fix this? Thanks
-
How to dynamically set Min count and Max Count values in Adobe Print Form?
How to set the Min Count and Max Count values dynamically in a Print Form? The values when set should over ride the values set in Binding Tab. This is all needed to print multiple Material Number labels on a single page - and the number of labels to
-
API for FND_LOOKUP_VALUES
Is there an API for FND_LOOKUP_VALUES? I need to create these dynamically for TCA relationship types. Thanks.
-
Hi, I set USEBTRFS="yes" in my rc.conf I have a partition with btrfs but during the boot I see anything about this partition... Or I did not understand what this variable XD tnx
-
Does anyone know how can I get rid of a virus that appear a website each time I am browsing? It takes me to a linkbucks website.