JtextPane : HTMLEditor : reading text
Hello All,
I have JtextPane , to which I have made an HTML editor by using a third party jar, which interprets html tags and represent them like a web browser . for e.g if HTML editor encounters <img .../> tag , it will display an image.Its working as per expectation.
When my automation testing team is reading the text from JTEXTPANE , the text coming as a html source like
<html>
<body>
<img src='sample.gif' /> ...
</body>
</html>And some part of text is also wrapping up which is restricting them to read line as its some times read as a half part line.
As a solution , before giving a input text to automation testing team , I tried by writing a regexp , which removes all htmltags from the source , write the out put to a file .
But after replacing all htmltags , the out put file still contains some line i.e. wrapped text previously (*restricting them to read line as its some times read as a half part line*.
So this is my pbm. Can any one please suggest me , how to deal with this pbm?
thanks
Aniruddha
Thanks for all the help. The isBold and isItalic work great, but how do I get the color. Here's the code I'm using at the moment. The output is exactly the same whether I use elem.getAttributes() or just elem. Any idea why?
private void dumpDoc( Element elem, int level )
boolean bold = false;
boolean italic = false;
LinkedList list = new LinkedList();
for( int i = 0; i <= level * 2; i++ )
System.out.println( "for loop" );
System.out.println( ' ' );
System.out.println( elem.getName() + "[" + elem.getStartOffset() + ", " +
elem.getEndOffset() + "]" + elem.hashCode() );
System.out.println( elem.getAttributes() );
if( !elem.isLeaf() && elem.getElementCount() != 0 )
for( int j = 0; j < elem.getElementCount(); j++ )
dumpDoc( elem.getElement( j ), level + 1 );
Similar Messages
-
How to download / read text attachment in Sender Mail Adapter IN XI
Hi
I would like to know how to download / read text attachment in sender mail Adapter & sent same attachment to target system using file adapter.
Please help how to design / resolve this concept.
Regards
DSRI would like to know how to download / read text attachment in sender mail Adapter & sent same
attachment to target system using file adapter.
Take help from this blog:
/people/michal.krawczyk2/blog/2005/12/18/xi-sender-mail-adapter--payloadswapbean--step-by-step
From the blog:
However in most cases
our message will not be a part of the e-mail's payload but will be sent as a file attachment.
Can XI's mail adapter handle such scenarios? Sure it can but with a little help
from the PayloadSwapBean adapter module
Once your message (attachment) is read by the sender CC, you can perform the basic mapping requirement (if any) to convert the mail message fromat to the file format.....configure a receiver FILE CC and send the message...this should be the design...
Regards,
Abhishek. -
How to read text from a web page
I want to read text from a web page. Can any body tell me how to do it.
Ok i tell you detail. visit the site " http://seriouswheels.com/" you will a index from A to Z which are basically car name index i want to read each page get car name and its model and store it in data base. I you can provide me the code i will be very thankful.
-
How to read text from PDF and HTML
I have got solution to read text form .txt file but did'nt get code for PDF and HTML.
I dont want to convert PDF to txt.
Please help me ...reading from a file is always the same. using the same strategy used for a .txt will allow you to read a .pdf file.
Offcourse in itself it will be useless becuase pdf files have a special internal structure.
html files are identical to txt files.
What are you trying to accomplisch with the files you are reading ? -
Reading text from server socket stream
I have a basic cd input program i've been trying to figure out the following problem for a while now, the user enters the artist and title etc and then a DOM (XML) file is created in memory this is then sent to the server. The server then echos back the results which is later printed on a html page by reading the replys from the server line by line.
The server must be run it listens for clients connecting the clients connect and send DOM documents through the following jsp code.
<%@page import="java.io.*"%>
<%@page import="java.net.*"%>
<%@page import="javax.xml.parsers.*"%>
<%@page import="org.w3c.dom.*"%>
<%@page import="org.apache.xml.serialize.*"%>
<%!
public static final String serverHost = "cdserver";
public static final int serverPort = 10151;
%>
<hr />
<pre>
<%
Socket mySocket = null; // socket object
PrintWriter sockOut = null; // to send data to the socket
BufferedReader sockIn = null; // to receive data from the socket
try {
// #1 add line that creates a client socket
mySocket = new Socket(serverHost, serverPort);
// #2 add lines that create input and output streams
// attached to the socket you just created
sockOut = new PrintWriter(mySocket.getOutputStream(), true);
sockIn = new BufferedReader(new InputStreamReader(mySocket.getInputStream()));
} catch (UnknownHostException e) {
throw e; // This time the JSP can handle the exception, not us
} catch (IOException e) {
throw e; // This time the JSP can handle the exception, not us
String cdTitle, cdArtist, track1Title, track1Time, track1Rating;
// Retrieve the HTML form field values
cdTitle = request.getParameter("cdtitle");
cdArtist = request.getParameter("cdartist");
track1Title = request.getParameter("track1title");
track1Time = request.getParameter("track1time");
track1Rating = request.getParameter("track1rating");
// Create a new DOM factory, and from that a new DOM builder object
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
DocumentBuilder builder = factory.newDocumentBuilder();
// Note that we are creating a new (empty) document
Document document = builder.newDocument();
// The root element of our document wil be <cd>
// It gets stored as the child node of the whole document (it is the root)
Element rootElement = document.createElement("cd");
document.appendChild(rootElement);
// Create an element for the CD title called <title>
Element cdTitleElement = document.createElement("title");
// Add a text code under the <title> element with the value that
// the user entered into the title field of the web form (cdTitle)
cdTitleElement.appendChild(document.createTextNode(cdTitle));
// Place the <title> element underneath the <cd> element in the tree
rootElement.appendChild(cdTitleElement);
// Create an <artist> element with the form data, place underneath <cd>
Element cdArtistElement = document.createElement("artist");
cdArtistElement.appendChild(document.createTextNode(cdArtist));
rootElement.appendChild(cdArtistElement);
// Create a <tracklist> element and place it underneath <cd> in the tree
// Note that it has no text node associated with it (it not a leaf node)
Element trackListElement = document.createElement("tracklist");
rootElement.appendChild(trackListElement);
// In this example we only have one track, so it is not necessary to
// use a loop (in fact it is quite silly)
// But the code below is included to demonstrate how you could loop
// through and add a set of different tracks one by one if you
// needed to (although you would need to have the track data already
// stored in an array or a java.util.Vector or similar
int numTracks = 1;
for (int i=0; i<numTracks; i++) {
String trackNum = Integer.toString(i+1);
Element trackElement = document.createElement("track");
trackElement.setAttribute("id", trackNum);
trackListElement.appendChild(trackElement);
// Track title element called <title>, placed underneath <track>
Element trackTitleElement = document.createElement("title");
trackTitleElement.appendChild(document.createTextNode(track1Title));
trackElement.appendChild(trackTitleElement);
// Track time element called <time>, placed underneath <track>
Element trackTimeElement = document.createElement("time");
trackTimeElement.appendChild(document.createTextNode(track1Time));
trackElement.appendChild(trackTimeElement);
// Track rating element called <rating>, placed underneath <track>
Element trackRatingElement = document.createElement("rating");
trackRatingElement.appendChild(document.createTextNode(track1Rating));
trackElement.appendChild(trackRatingElement);
OutputFormat format = new OutputFormat();
format.setIndenting(true);
// Create a new XMLSerializer that will be used to write out the XML
// This time we will serialize it to the socket
// #3 change this line so that it serializes to the socket,
// not to the "out" object
XMLSerializer serializer = new XMLSerializer(writer, format);
serializer.serialize(document);
// Print out a message to indicate the end of the data, and
// flush the stream so all the data gets sent now
sockOut.println("<!--QUIT-->");
sockOut.flush();
BufferedReader stdIn = new BufferedReader(new InputStreamReader(System.in));
String fromServer;
String fromUser;
#4 add a while loop that reads text from the
server socket input stream, line by line, and prints
it out to the web page, using out.println(...);
Note that because the reply from the server will contain
XML, you will need to call upon the toHTMLString() method
defined below to escape the < and > symbols so that they
will display correctly in the web browser.
Also note that as you receive the reply back from the
server, you should look out for the special <!--QUIT-->
string that will indicate when there is no more data
to receive.
while ((fromServer = sockIn.readLine()) != null) {
out.println(sockIn.readLine());
// If the reply from the server said "QUIT", exit from the
// while loop by using a break statement.
if (fromServer.equals("QUIT")) {
out.println("Connection closed - good bye ...");
// Print the text from the server out to the user's screen
out.println("Reply from Server: " + fromServer);
// Now read a line of text from the keyboard (typed by user)
fromUser = stdIn.readLine();
// If it wasn't null, print it out to the screen, and also
// print a copy of it out to the socket
if (fromUser != null) {
out.println("Client: " + fromUser);
sockOut.println(fromUser);
// Close all the streams we have open, and then close the socket
sockOut.close();
sockIn.close();
mySocket.close();
%>
I'm suppose to modify the commented sections labled with #.
#1,2 are correct but i have doubts on the 3rd and 4th modification.
for #3 i changed so i serializes to the socket not to the "out" object:
from
XMLSerializer serializer = new XMLSerializer(out, format);
to
XMLSerializer serializer = new XMLSerializer(writer, format);
with "out" it prints out some of the results entered but it just hangs i'm thinking it might be the while loop that i added in #4. If i changed it to serialize the socket XMLSerializer serializer = new XMLSerializer(writer, format); it doesn't print out nothing at all; just a blank screen where it hangs.
I can post the rest of the code (server thats in java and cdinput.html) but since i want to keep my post short and if required i'll post it later on i also omitted some of the code where it creates the DOM textnodes etc to keep my post short.On your previous thread, why did you say the server was using http POST and application/xml content type when it quite obviously isn't, but a direct socket communication that abuses XML comments for message end delimiters?
The comments imply you need to wait for "<!--QUIT-->" on a line by itself, but your loop is waiting for "QUIT".
Pete -
Is there a way to have the iPad 2 "read" text from iBooks as with web sites or pages?
is there a way to have the iPad 2 "read" text from iBooks as with web sites or pages? A different App perhaps?
Isn't that you asking how to get it (undefined) back?
If you never had Pages '09, you can buy it from Amazon very cheaply:
http://www.freeforum101.com/iworktipsntrick/viewtopic.php?t=432&sid=f68e84cd2ec6 123bd2ed93806c7e7fb6&mforum=iworktipsntrick
Peter -
What is use of Read-Text command in Sapscript plz replay
What is use of Read-Text command in Sapscript plz replay
i m geting problem with read-text command in sapscript as will as
perform and endperform .Hi Majid,
It's a function module to read the texts from a text file. Generally it is used to retrieve the long texts.
The function module reads the desired text from the text file, the text memory, or the archive. You must fully specify the text using OBJECT, NAME, ID, and LANGUAGE. An internal work area can hold only one text; therefore, generic specifications are not allowed with these options.
After successful reading, the system places header information and text lines into the work areas specified with HEADER and LINES.
If a reference text is used, SAPscript automatically processes the reference chain and provides the text lines found in the text at the end of the chain. If an error occurs, the system leaves the function module and triggers the exception REFERENCE_CHECK.
CALL FUNCTION 'READ_TEXT'
EXPORTING
CLIENT = SY-MANDT
OBJECT = ?...
NAME = ?...
ID = ?...
LANGUAGE = ?...
ARCHIVE_HANDLE = 0
IMPORTING HEADER =
TABLES LINES = ?...
EXCEPTIONS ´
ID =
LANGUAGE =
NAME =
NOT_FOUND =
OBJECT =
REFERENCE_CHECK =
WRONG_ACCESS_TO_ARCHIVE =
Export parameters
Specify the client under which the text is stored. If you omit this parameter, the system uses the current client as default.
Reference field: SY-MANDT
Default value: SY-MANDT
OBJECT
Enter the name of the text object to which the text is allocated. Table TTXOB contains the valid objects.
Reference field: THEAD-TDOBJECT
NAME
Enter the name of the text module. The name may be up to 70 characters long. Its internal structure depends on the text object used.
Reference field: THEAD-TDNAME
ID
Enter the text ID of the text module. Table TTXID contains the valid text IDs, depending on the text object.
Reference field: THEAD-TDID
LANGUAGE
Enter the language key of the text module. The system accepts only languages that are defined in table T002.
Reference field: THEAD-TDSPRAS
ARCHIVE_HANDLE
If you want to read the text from the archive, you must enter a handle here. The system uses it to access the archive. You can create the handle using the function module ACHIVE_OPEN_FOR_READ.
The value '0' indicates that you do not want to read the text from the archive.
Reference field: SY-TABIX
Default value: 0
Import parameters:
HEADER
If the system finds the desired text, it returns the text header in this parameter.
Structure: THEAD
Table parameters:
LINES
The table contains all text lines that belong to the text read.
Structure: TLINE
Exceptions:
ID
The text ID specified in the parameter ID does not exist in table TTXID. It must be defined there together with the object of the text module.
LANGUAGE
The parameter LANGUAGE contains a language key that does not exist in table T002.
NAME
The parameter NAME contains the name of a text module that does not correspond to the SAPscript conventions.
Possible errors:
The field contains only blanks.
The field contains the invalid characters * or ,.
OBJECT
The parameter OBJECT contains the name of a text object that does not exist in table TTXOB.
NOT_FOUND
The system did not find the specified text module.
REFERENCE_CHECK
The text module to be read has no text lines of its own but refers to the lines of another text module. This reference chain can include several levels. For the current text, the chain is interrupted, that is, one of the text modules referred to in the chain no longer exists.
WRONG_ACCESS_ TO_ARCHIVE
The exception WRONG_ACCESS_TO_ARCHIVE is triggered if an archive is accessed using an incorrect or non-existing archive handle or an incorrect mode (that is, read if the archive is open for writing or vice versa).
Br,
laxmi. -
Reading text file to make a list
Hello ,
I want to read a specific column from the text file if the columns are separated by a space.
When the whole file (as shown here http://imageshack.com/a/img834/6321/k55hx.jpg
) is read its column1 names should be visible in a drop list and whenever a name is selected from the list it should select its respective value from column2 in the text file and display the value in indicator.
I tried as shown here(http://imageshack.com/a/img829/6821/x4h0.jpg ) and got the output like this(http://imageshack.com/a/img840/1431/ior7.jpg ) but I am unable to get the required.
Can someone help me out with this.
Thanks.Hi stefan57.
If I understand you correctly, you are trying to make a dropdown list with the values from the first coloum, and when the user changes this values, you want the data to be shown.
I have made a small exampled that demostrates how this can be done.
(please note, that this code should be further improved, eg. by implementing proper error handling)
Best Regards
Alex E. Petersen
Certified LabVIEW Developer (CLD)
Application Engineer
Image House PantoInspect
Attachments:
Read Text.vi 25 KB
File.txt 1 KB -
Reading text file to JEditorPane
Hi,
I'm trying to read text file to JEditorPane and it works but first line is always missing. Here is the code for reading:
try {
in = new BufferedReader(new FileReader(filePathIn));
while ((lineIn = in.readLine()) != null) {
editorPane.read(in, new Object());
} catch (IOException ie)...Any suggestions?in.readLine is changing the input stream position.
Do this instead:
FileInputStream in = new FileInputStream(filePathIn);
while (in.available() != 0)
editorPane.read(in, new Object()); -
Read text from purchase order.
I have few queries regarding texts in a document.
1. How do i identify the id for a text of a line item in any PO document?
2. Secondly a pgm is using read_text to get this text. before which 'stxh' is queried. But when i debugged i found that for a particular document there is no entry in this table though there is a text in the document and hence doesnot perform a read_text. The text is auto generated through info records. How to retrieve this text?
Ans wil be appreciated and rewardedHi Ravikumar thanks for u quick reply.
This is wht is currently coded.
concatenate values to get item text for read text function
invar3+0(10) = invar1. "PO number
invar3+10(5) = invar2. "PO line number
SELECT SINGLE * FROM stxh WHERE tdobject = 'EKPO'
AND tdname = invar3
AND tdid = 'F01'
AND tdspras = sy-langu.
IF sy-subrc = 0.
invar4 = invar3.
reading the text for the document items.
CALL FUNCTION 'READ_TEXT'
EXPORTING
id = 'F01'
language = sy-langu
name = invar4
object = 'EKPO'
TABLES
lines = it_itab.
I have seen some PO's which have info rec texts in that, which gets pulled by the above code...first thing is its id is F02 which exist in STXH table also there is other text with F01 id, and hence the table it_itab gets both these text hence no pbm.
but i came across a PO which has only one text which is info rec text with id F05 and is not store in stxh and hence doesnot get pulled by read_text fm. How do i change my cod to get this text which should not hamper other PO's as well.
As mentioned in above msgs, this F05 could be retrieved by providing object name as EINE.
anyhelp will be appreciated and rewarded.
thanks -
Indesign CS3-JS - Problem in reading text from a text file
Can anyone help me...
I have an problem with reading text from an txt file. By "readln" methot I can read only the first line of the text, is there any method to read the consecutive lines from the text file.
Currently I am using Indesign CS3 with Java Script (for PC).
My Java Script is as follows........
var myNewLinksFile = myFindFile("/Links/NewLinks.txt")
var myNewLinks = File(myNewLinksFile);
var a = myNewLinks.open("r", undefined, undefined);
myLine = myNewLinks.readln();
alert(myLine);
function myFindFile(myFilePath){
var myScriptFile = myGetScriptPath();
var myScriptFile = File(myScriptFile);
var myScriptFolder = myScriptFile.path;
myFilePath = myScriptFolder + myFilePath;
if(File(myFilePath).exists == false){
//Display a dialog.
myFilePath = File.openDialog("Choose the file containing your find/change list");
return myFilePath;
function myGetScriptPath(){
try{
myFile = app.activeScript;
catch(myError){
myFile = myError.fileName;
return myFile;
Thanks,
Bharath Raja GHi Bharath Raja G,
If you want to use readln, you'll have to iterate. I don't see a for loop in your example, so you're not iterating. To see how it works, take a closer look at FindChangeByList.jsx--you'll see that that script iterates to read the text file line by line (until it reaches the end of the file).
Thanks,
Ole -
How to read text in .kep files
hey friends,
how to read text in .kep files
please help me .
with regards,
s.jagadeesh babuHi,
check this link:
http://help.sap.com/saphelp_nw04s/helpdata/en/8f/42a293e35011d29b340000e8a4b41d/content.htm
.kep files are SapShow Training Files. They can be played with sapshow.exe in Knowledge Warehouse.
SAP Show is KW Viewer Application. You can use it to see Kep files. It can be run in windows without the SAP environment. To run SAP Show (4.6D version) you just need 3 files. First is SAP show executable file, another two are Sapstg.dll and ZLib.dll. You can easily find these files on internet.
Regards,
Niraj -
How to Write BUFFER & Read TEXT with Encrypt file ?
I'm using Windows Phone 8.1 RT.
I have a issue :
- I write a BUFFER encrypted to file. After, I read file with TEXT. It's throw exception : No mapping for the Unicode character exists in the target multi-byte code page. (//ERROR 2)
- I write a TEXT encrypted to file. After, I read file with BUFFER. It's throw exception : The supplied user buffer is not valid for the requested operation. (//ERROR 1)
Code Write Buffer & Read Text.
//Write Textstring msg = EncryptText.Text;
//ERROR 1 - Use 1 or 2
await WriteTextAsync(this.file, msg);
//ERROR 1
//Read Buffer
string msg;
//ERROR 1 - Use 1 or 2
IBuffer buffer = await ReadBufferAsync(this.file);
StreamReader stream = new StreamReader(buffer.AsStream());
msg = stream.ReadToEnd();
//ERROR 1
Code Encrypt-Decypt.
public static string EncryptString(string msg)
var bufferMsg = CryptographicBuffer.ConvertStringToBinary(msg, BinaryStringEncoding.Utf8);
var bufferMsgEncrypted = Encrypt(bufferMsg);
var msgEncrypted = CryptographicBuffer.EncodeToBase64String(bufferMsgEncrypted);
return msgEncrypted;
}public static IAsyncAction WriteTextAsync(IStorageFile file, string msg)
return FileIO.WriteTextAsync(file, EncryptString(msg));
public static IBuffer Decrypt(IBuffer bufferMsg)
var key = CreateKey(KEY);
var aes = SymmetricKeyAlgorithmProvider.OpenAlgorithm(SymmetricAlgorithmNames.AesCbcPkcs7);
var symetricKey = aes.CreateSymmetricKey(key);
var bufferMsgDecrypted = CryptographicEngine.Decrypt(symetricKey, bufferMsg, null);
return bufferMsgDecrypted;
}public static IAsyncOperation<IBuffer> ReadBufferAsync(IStorageFile file)
var buffer = FileIO.ReadBufferAsync(file);
Task<IBuffer> result = Task.Run<IBuffer>(async () =>
var Buffer = await buffer;
return Decrypt(Buffer);
return result.AsAsyncOperation();
Link demo code :
https://drive.google.com/file/d/0B_cS3IYO936_akE0cmI4bExJMjh0RU9qR3RvWDBWWElZWC1z/view?usp=sharingPlease provide a working app so this can be tested. You can upload to OneDrive and share a link here.
Matt Small - Microsoft Escalation Engineer - Forum Moderator
If my reply answers your question, please mark this post as answered.
NOTE: If I ask for code, please provide something that I can drop directly into a project and run (including XAML), or an actual application project. I'm trying to help a lot of people, so I don't have time to figure out weird snippets with undefined
objects and unknown namespaces. -
Problem with reading text from .DOC files through java and POI
I have used a jar file "poi-scratchpad-3.2-FINAL-20081019.jar" and "poi-3.2-FINAL.jar" to read text from a .DOC file. I used the "getParagraphText()" function of the class "org.apache.poi.hwpf.extractor.WordExtractor" to get the text.
I am able to get the text in the .DOC file but along with that i am getting the following messages/warnings
Current policy properties
* thread.thread_num_limited: true*
* file.write.state: disabled*
* net.connect_ex_dom_list:*
* mmc.sess_cab_act.block_unsigned: false*
* mmc.sess_cab_act.action: validate*
* mmc.sess_pe_act.block_blacklisted: false*
* mmc.sess_pe_act.block_invalid: true*
* jscan.sess_applet_act.stub_out_blocked_applet: true*
* file.destructive.in_list:*
* jscan.sess_applet_act.block_all: false*
* file.write.in_list:*
* file.nondestructive.in_list:*
* window.num_limited: true*
* file.read.state: disabled*
* jscan.session.origin_uri: http://mirrors.ibiblio.org/pub/mirrors/maven2/org/apache/poi/poi/3.2-FINAL/poi-3.2-FINAL.jar*
* file.nondestructive.state: disabled*
* jscan.session.user_ipaddr: 10.136.64.153*
* net.connect_other: false*
* thread.thread_num_max: 8*
* file.destructive.ex_list:*
* file.nondestructive.ex_list:*
* file.write.ex_list:*
* jscan.sess_applet_act.sig_invalid: block*
* file.read.in_list:*
* mmc.sess_cab_act.block_invalid: true*
* jscan.session.policyname: TU1DIERlZmF1bHQgUG9saWN5*
* mmc.sess_pe_act.action: validate*
* thread.threadgroup_create: false*
* net.connect_in_dom_list:*
* net.bind_enable: false*
* jscan.sess_applet_act.sig_trusted: pass*
* jscan.session.user_name: 10.166.64.201*
* jscan.session.user_hostname:*
* file.read.ex_list:*
* jscan.sess_applet_act.sig_blacklisted: block*
* jscan.session.daemon_protocol: http*
* net.connect_src: true*
* jscan.sess_applet_act.unsigned: instrument*
* mmc.sess_pe_act.block_unsigned: false*
* file.destructive.state: disabled*
* mmc.sess_cab_act.block_blacklisted: true*
* window.num_max: 5*
Below the above messages/warnings the data is getting printed. Only the text part of the data is retrieved not the fonts, styles and bullets etc.
Can anyone explain me why I am getting above warnings and how can I remove them. Is it possible to fetch the text depending on delimiters.
Thanks in advance,
Tiijnar
Edited by: tiijnar on May 21, 2009 2:45 AMThe jar files which were used are downloaded from http://jarfinder.com. Those jars created the problem of displaying those messages on console. I downloaded APIs from apache.org and used them in my application. Now my application is running good.
Tiijnar -
i am not able to read text file in 10g forms. using webutil.pll and webutil.lib
here i posted the code . i am not getting message 2, client_text_io.fopen is not working what could be the reason.
DECLARE
in_file client_TEXT_IO.FILE_TYPE;
V_LINE_COUNT number;
linebuf VARCHAR2(1800);
V_var1 varchar2(80);
V_var2 varchar2(80);
V_var3 varchar2(80);
V_var4 varchar2(80);
V_var5 varchar2(80);
filename VARCHAR2(30);
l_var number;
blnRet BOOLEAN;
begin
DELETE FROM NIRU_TEMP;
:file_path:=LTRIM(RTRIM(:file_path));
MESSAGE('1');
in_file := client_text_io.fopen(UPPER(:file_path),'r');
MESSAGE('2');
loop
V_LINE_COUNT := V_LINE_COUNT + 1;
client_text_io.get_line(in_file,linebuf);
MESSAGE('5');
V_var1 := substr(linebuf,1,(instr(linebuf,',')-1)) ;
MESSAGE('6'||V_VAR1);
MESSAGE('6'||V_VAR1);
l_var := length(v_var1);
V_var2 := substr(linebuf,l_var+2,(instr(linebuf,','))) ;
--V_var3 := substr(linebuf,15 ,10 );
V_var2 :=LTRIM(RTRIM(V_var2));
MESSAGE('6'||V_var2);
MESSAGE('6'||V_var2);
:p_id := v_var1;
:p_desc :=v_var2;
--IF V_var2 = '' THEN
--V_var3 :='';
--else
--V_var3 := TO_NUMBER(V_var2) ;
--end if;
--V_var5 := substr(linebuf,26 ,70 );
INSERT INTO NIRU_TEMP VALUES (V_var1,V_var2);
client_text_io.new_line;
:System.Message_Level := '20';
commit;
:System.Message_Level := '0';
--<<end_loop>>
--null;
next_record;
end loop;
client_TEXT_IO.FCLOSE(in_file);
exception
WHEN OTHERS THEN
MESSAGE('ERROR'||SQLCODE||' '||SQLERRM);
--exit;
end;Hello Francois,
You have a solution for this problem?
I have a problem like this. While reading a text file, such as size of 7MB, long, between 15-30 minutes.
See...
declare
arq client_text_io.file_type;
linha varchar2(800);
v_total number := 0;
v_icms number := 0;
begin
:valor_total := 0;
:valor_icms := 0;
arq := client_text_io.fopen(:arquivo,'r');
loop
client_text_io.get_line(arq,linha);
if substr(linha,1,1) = '1' then
v_total := v_total + (to_number(substr(linha,302,13))/100);
v_icms := v_icms + (to_number(substr(linha,262,13))/100);
end if;
end loop;
client_text_io.fclose(arq);
exception
when no_data_found then
:valor_total := v_total;
:valor_icms := v_icms;
message('Realizado com sucesso!');
message('Realizado com sucesso!');
end;
Maybe you are looking for
-
Creative cloud is showing a red warning sign on all my files.
TL;DR: All my files have a red warning sign in the Cloud directory. What does it mean and how do I fix it? Here's what happens: I have two Finder windows open, one with the Cloud folder, and the other with files I want to synch. I option+drag my file
-
Error in merge query of the Proc.
Hi all, Below merge query working fine, if I execite independently. I am getting error as "ORA-00900: invalid SQL statement" when i paste this code inside the procedure. However, if I comment the lines written in bold, proc is working fine. Not sure
-
XSAN, ACLs and new OD users.
I have xSAN FS with enabled ACLs and OD. If i create ACL for existing folders and assign groupe(A) permissions to it. Rules work perfect. But only for usesr in this group (A) which was added before ACL was assigned. If i create new OD user and add it
-
I have a strange situation where I burned a DVD via DVD studio and I am using final cut pro on FCP 6.0 and the DVD plays fine on my 8 core mac pro, but not on a g5 imac or PC's I burned 2 disks, 1 high quality DVD 90 minute video using compressor to
-
Everytime I click on something whether it's on Google or opening an Email etc.. I get a pop up ad appear in another tab. I have tried everything to stop this increasing the pop up blockers and other things it still happens. I don't know what i can do