Read new line of returned message
Hi,
I am new to labview and I am trying to get the return message from an instrument which is three lines long, but only one line gets displayed. How can I read past the carriage return?
Thanks.
Angelia
Check the Termination char setting for comport
http://zone.ni.com/reference/en-XX/help/371361G-01/lvinstio/visa_configure_serial_port/
termination char calls for termination of the read operation. The read operation terminates when the termination char is read from the serial device. 0xA is the hex equivalent of a linefeed character (\n). Change the termination char to 0xD for message strings that terminate with a carriage return (\r).
Or just read it 3 time one line at a time to get all the data. Set the number of bytes to read to something larger than you will ever get back on each line.
Omar
Similar Messages
-
How do i read new line char in jtextarea.getText()?
guys, how do i read new line character in jTextArea.getText()? i'll appreciate ur help tnx..:))
Use a StringRead, then you can treat the text file a file.
-
Report output on one Line, without new line (cariage return)
Hello I use a user defined report with style plsql. The output is with many dbms_output.put_line and is displays in only one line. May I ask you to get the output on more the one line. For eatch dbms_output I wont to have a new line (cariage return). Many thanks for help in advance
In the body of the report, I used HTML tags to control the appearance.
For example, to see what database features you have used in your database today, the following code works well:
begin
dbms_output.enable(1000000);
dbms_output.put_line('<PRE>');
for rc in ( select output from
table(dbms_feature_usage_report.display_text)
) loop
dbms_output.put_line(rc.output);
end loop;
dbms_output.put_line('</PRE>');
end; This yields the following output
DB FEATURE USAGE report for
DB Name DB Id Release Total Samples Last Sample Time
ABCPROD 900004321 10.2.0.1.0 78 09-Oct-09 18:29:17
DB Feature Usage Summary DB/Release: ABCPROD/10.2.0.1.0
-> This section displays the summary of Usage for Database Features.
-> The Currently Used column is TRUE if usage was detected for
-> the feature at the last sample time.
Curr-
ently Detected Total Last Usage
Feature Name Used Usages Samples Time
Automatic SQL Execution Memory TRUE 78 78 10/09/09 18:29
Automatic Segment Space Management (syste TRUE 78 78 10/09/09 18:29
etc.However if you comment the lines with the beginning and terminating tags for preformatted text, then you get output confined to one line that starts out like:
DB FEATURE USAGE report for DB Name DB Id Release Total Samples Last Sample Time ------------ ----------- and you'll have to scroll to the right or figure how you want to break it up -- That's too much work.
My configuration:
Windows XP SP3
SQL Developer 1.5.5 Build MAIN-5969
Java(TM) Platform 1.6.0_06 -
XSLT - New Line/Carriage Return not displaying when deployed
Hello everyone,
I have an XSL Style Sheet that is supposed to transform an XML into plain text using Oracle SOA 11g BPEL transformation. The plain text transformation is working fine, but whenever I try to add a new line or carriage return, the text output doesn't reflect that. I've tried several ways of adding the line break but none of them have worked. This is the XSLT I'm using for testing purposes:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:a="urn:oracle:b2b:X12/V4010/850" version="1.0">
<xsl:output method="text" omit-xml-declaration="yes" indent="no"/>
<xsl:template match="/a:Transaction-850">
<!-- New line -->
<xsl:variable name='newline'><xsl:text>
</xsl:text></xsl:variable>
<xsl:value-of select="a:Internal-Properties/a:Data-Structure/a:Property[@Name='InterchangeUsageIndicator']" />
<xsl:text>
</xsl:text>
<xsl:value-of select="$newline" />
<xsl:text>
</xsl:text>
<xsl:text> </xsl:text>
<xsl:text> </xsl:text>
<xsl:text>2000ITITM</xsl:text>
</xsl:template>
</xsl:stylesheet>
When I try it out in an online XSLT test tool, it gives the output as expected:
P
2000ITITM
When I deploy the composite, I noticed that the XSLT in the MDS repository ignores the line breaks, *#xAs, etc. and just closes the <xsl:text/> tags:
<?xml version='1.0' encoding='UTF-8'?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:a="urn:oracle:b2b:X12/V4010/850" version="1.0">
<xsl:output method="text" omit-xml-declaration="yes" indent="no"/>
<xsl:template match="/a:Transaction-850">
<xsl:variable name="newline">
<xsl:text/>
</xsl:variable>
<xsl:value-of select="a:Internal-Properties/a:Data-Structure/a:Property[@Name='InterchangeUsageIndicator']"/>
<xsl:text/>
<xsl:value-of select="$newline"/>
<xsl:text/>
<xsl:text/>
<xsl:text>2000ITITM</xsl:text>
</xsl:template>
</xsl:stylesheet>
And so, because of that, it just gives me the following output:
P2000ITITM
I have no idea why it's ignoring the new line characters, so any guidance would be appreciated.
Thank you all for your help and time!
Edit: I tried concatenating as follows:
<xsl:value-of select="concat('36','
')"/>
<xsl:value-of select="concat('24','
')"/>
...which shows up as is when I look at it in the MDS repository, however the text output still shows no line breaks...
Message was edited by: dany36Ah I'm such a newbie. I was able to get it displayed by doing the following:
<xsl:variable name="newline" select="'
'" />
This would show up correctly in the MDS repository, too. -
How can i read a new line charchter in forms pl/sql.
I have a multiline address feild, but I have to read the data in one single line.If you need to parse the original multi-line input into seperate fields then some code like the example below might help? It is a simple package which has two functions, one which returns the number of lines in the users input (based on chr(10) delimeter) and another which will extract a given line of that input (ie - give me line 3 of the address)
package multiline is
function count(input varchar2) return number;
function line(input varchar2, line_number number) return varchar2;
end;
package body multiline is
delimeter constant varchar2(1) default chr(10);
function count(input varchar2) return number is
begin
if input is not null then
if instr(input, delimeter) > 0 then
return ((length(input) - length(replace(input, delimeter, ''))) / length(delimeter)) + 1;
else
return 1;
end if;
else
return 0;
end if;
end;
function line(input varchar2, line_number number) return varchar2 is
counter number;
pos_1 number default 1;
pos_2 number default 1;
begin
if line_number <= multiline.count(input) then
for counter in 1..line_number loop
if counter > 1 then
pos_1:= pos_2;
end if;
pos_2:= instr(input||delimeter, delimeter, pos_2 + 1);
end loop;
return substr(input||delimeter, case when pos_1 > 1 then pos_1 + 1 else 0 end, (pos_2 - pos_1) - case when pos_1 > 1 then 1 else 0 end);
else
return null;
end if;
end;
end;
Is this any use to you?
Pete -
Reading new line character as part of a input stream
I am reading and parsing an ASCII text file in the Windows environment. End Of Line marker is \r\n as expected for Windows. However, I have discovered that \n can be part of the data stream being sent to me and it doesn't mean a new line or new record. It should be treated as part of the data stream and not processed a s a new line. However, the readline() method I am using treats it as such and the read is cut short and therefore I do not get all of the data for that record. I want to avoid reading char by char if I can as this is a large text file.
Any Ideas as to how to let the \n go through and to wait for \r\n as the real end of line?
ThanksI think what I would do is implement my own reader, with my own readLine(). Should be trivial - just subclass the reader you are using, and read and look at each byte, not returning until you see the \r\n sequence you want to treat as end of line.
-
How can i read a new line charchter in forms pl/sql.
I have a multiline address feild, but I have to read the data in one single line.Thats great many thanks it works, BUT now I got another problem what if we are not sure of no of newline character the feild have?
Do we need to write a function for it OR we can achive it through SQL itself! -
Prior to updateing to the most recent version of Skype, I used to be able to type messages with line breaks in them.
Like this...
without Skype sending the message. Now every line is sent as a new message - infuriating.
There was an option to select/deselect this behaviour and I can't find it in the new version.
Can someone enlighten me.
Thanks.Nope. Micro$oft wants the extra IM charges when you hit enter by mistake. Be glad they do not send off the message when you type a period.
Try to remember to use ctrl-enter. And do not hit enter when you mean to type a single-quote. -
Fnd_new_messages won't display "new line" in sswa
I created a new message in FND_NEW_MESSAGE, and I can't get "new lines"/"carriage returns" to display properly.
Can someone explain how to get this to work? I am currently using BR, enclosed in <>, to force newline.
For Example: ( i am using the tag properly, but for this posting i need to use the spaces before after BR) Message_text = 'This is line 1 < BR > This is line 2 ' <BR>
In SSWA, should display as: <BR>
This is line 1 <BR>
This is line 2
<BR>
however, displaying as:
This is line 1 < BR > This is line 2
ThanksIf your requirement is to have custom html message rather then the standard message, you can pass ur custom html in OAFormattedtext bean
--Mukul -
Hi -
Im using the FileWriter and BufferedWriter classes to output text into a .txt file.
The text I am writing is taken from another text file using the FileReader and BufferedReader classes.
The text is reading from the file, and will also output to the new text file, however it won't insert a new line, it only inserts an 'unprintable' character i.e. an empty square
My code is below - its only starting out so its farily simple at the moment, just reading from one file and outputting to another.
Is there a way i can get the actual new line/carriage return inserted instead of the empty square. (im running Windows XP)
Thanks in advance
import java.io.*;
public class Pad {
private String inputPath;
private String outputPath;
/** Creates a new instance of Pad */
public Pad() {
inputPath = "C:\\OUTBOUND.TXT";
outputPath = "C:\\04'06.txt";
* @param args the command line arguments
public static void main(String[] args) {
// TODO code application logic here
System.out.println("PAD File");
//Read PAD File
Pad p = new Pad();
p.readPADFile(p.inputPath, p.outputPath);
public void readPADFile(String inputPath, String outputPath)
inputPath = this.inputPath;
outputPath = this.outputPath;
//System.out.println(inputPath);
int recordCount = 0;
String record = null;
try
FileReader fr = new FileReader(inputPath);
FileWriter fw = new FileWriter(outputPath);
BufferedReader br = new BufferedReader(fr);
BufferedWriter bw = new BufferedWriter(fw);
record = new String();
while((record = br.readLine())!=null)
recordCount++;
//System.out.println(recordCount + ": " + record);
bw.write(record + "\n");
bw.close();
br.close();
fw.close();
fr.close();
}catch(IOException e)
System.out.println("IOException Error");
e.printStackTrace();
System.out.println(e.toString());
}I assume by using the
System.getProperty("line.separator") that this will
work independent of platform.Yes. And using bw.println() instead of bw.print() will already do it for you. So all you need to change in your program are two letters. -
New line character in cipher text?
Friends,
I am encrypting a text in Triple DES/CBC mode/Nopadding mode. the length of text is 6500 bytes. in the cipher text that i get, it has new-line character(\n) & carriage return characters. As a result of this i m unable to read the cipher text from a C program(as it is not fully reading the cipher text). is there any methodology to overcome this problem. is there any way to avoid the new-line & carriage return characters in cipher text.
Also is there any criteria like, the plaintext can be only max of this much bytes?
Thanks in AdvanceThe result of your encryption is bytes and not characters so your C program should process it as bytes and not as characters then bytes '\r' and '\n' will not be interpretted.
It would be interresting to see your C code. -
Hi,
I am working on old Flex3 (Cairngorm2) app.
One of TextArea's there is completely ignoring new lines (Carriage Return/Line Feed)
and even skips some spaces (others work fine).
Code is pretty simple (well, little simplified here):
<fx:TextArea text="myText" selectable=true change=updateText(event)"/>
private function updateText(evt:Event):void {
var event:UpdateEvent = new UpdateEvent(UpdateEvent.UPDATE_EVENT);
event.myText=myText.text;
trace("myText"+event.myText) //added by me
event.dispatch();
I have read about weird behaviors of TextArea (skipping or even doubling some characters) on the net,
but so far could not find anything applicable in that case.
For example, something like myText.text.replace("\n", "\r") doesn't change anything.
I guess, there is no "\n" there.
If I trace, it returns line without newlines (like: 'startskip1lineskip2linesend;').
But if I copy-paste that line to say another TextArea on the screen (or non flex Chat app, I would get multiline text:
'start
skip1line
skip2lines
end;
And for various reasons I can't debug that app.
Any idea what might be wrong and how to fix it?
Please help!
TIA,
Oleg.
P.S.: App connects to SPs in the Database via Web Service. No BlazeDS.I haven’t heard of this problem before. I’d guess there is code running that is removing the line breaks. I would first check to see if both \r and \n are being removed or not. Then I’d add a keyDown handler and single step in the debugger through the hundreds of lines of code that run when you hit a key. My guess is that you’ll end up in code you didn’t expect that is removing the whitespace.
-
I am trying to create a new line by returning a variable from a function by coding the following which worked for the last version of HTML_DB and understood that after my variable named vlname I wanted a new line
msg := 'NAME: ' || vlname ||'<br><br>';
When passing back the value of msg now in Application express. This exact code I repeat worked for the last version of HTML_DB.
I don't know why but the new version thinks it's literal
and is displaying the name and then actually prints <br><br>.
Does anyone have a ny suggestions ?
Thanks
AronI just did the following:
Created this function:
create function br_test
return varchar2
is
begin
return '<br>qwerty<br>qwerty<br>';
end;Created a blank page with a html region. I then created an an item of type Display as Text (does not save state). Item Source type = PL/SQL expression or function and Source value or expression = br_test.
When I run this qwerty is shown twice on seperate lines. What is different in you case?
Regards Pete -
Hello All,
As mentioned in title, i am stuck up with that articular error from last three days,
i have following scenario, my SQL server 2008, my oracle 10g are on both same machine with OS Windows Server 2008.
the following error generated on my management studio when i execute my procedure written in my SQL server. Following is original source code snippet after error massage.
OLE DB provider "OraOLEDB.Oracle" for linked server "ORCL" returned message "New transaction cannot enlist in the specified transaction coordinator. ".
Msg 50000, Level 16, State 2, Procedure PROC_MIGRATE_MST_FRM_ORA_SQLSERVER, Line 43
The operation could not be performed because OLE DB provider "OraOLEDB.Oracle" for linked server "ORCL" was unable to begin a distributed transaction.
BEGIN TRY
-- MIGRATION OF PR_COMPANY_MH START
BEGIN TRANSACTION T1
PRINT 'mILAN NNNNNNNNN 11'
INSERT INTO PROD.PR_COMPANY_MH
SELECT * FROM OPENQUERY(ORCL, 'SELECT * FROM PR_COMPANY_MH WHERE SQL_FLG = ''N'' ')
PRINT 'mILAN NNNNNNNNN 12'
UPDATE OPENQUERY(ORCL, 'SELECT SQL_FLG FROM PR_COMPANY_MH WHERE SQL_FLG = ''N''')
SET SQL_FLG = 'Y'
--EXECUTE ('UPDATE PROD.PR_COMPANY_MH SET SQL_FLG = ''Y'' ') AT [ORCL]
PRINT 'mILAN NNNNNNNNN 13'
COMMIT TRANSACTION T1
-- MIGRATION OF PR_COMPANY_MH END
END TRY
BEGIN CATCH
PRINT 'mILAN NNNNNNNNN 14'
ROLLBACK TRANSACTION T1
PRINT 'mILAN NNNNNNNNN 15'
SELECT
@ErrorNumber = ERROR_NUMBER(),
@ErrorSeverity = ERROR_SEVERITY(),
@ErrorState = ERROR_STATE(),
@ErrorLine = ERROR_LINE(),
@ErrorProcedure = ISNULL(ERROR_PROCEDURE(), '-');
PRINT 'mILAN NNNNNNNNN 16'
SELECT @ErrorMessage = ERROR_MESSAGE();
RAISERROR (@ErrorMessage, @ErrorSeverity, @ErrorState, @ErrorNumber, @ErrorProcedure)
PRINT 'mILAN NNNNNNNNN 17'
END CATCH
this perticular part is raising that error, and i had tried every configuartion on my local machine related to MS DTC.
When i remove my transaction code, its work just fine no exception raise, but when i use then i.e. BEGIN TRAN, COMMITE TRAN, AND ROLLBACK TRAN. its giving me error, other wise its fine.
Please Help or disscus or suggest why my transaction base code is not woking????
thanks in advance.
Regards,
MilanSorry again, I am new on any kind of forum, so i am learning now, following is the error massage generated by SQL Server. and its not
an architecture problem, i had just included my complete architecture to be more informative while asking for the solution or suggestion. My real problem is T-SQL, i think and its related to Distributed queries raise in SQL Server in Oracle Link Server.
OLE DB provider "OraOLEDB.Oracle"
for linked server "ORCL" returned message "New transaction cannot enlist in the specified transaction coordinator. ".
Msg 50000, Level 16, State 2, Procedure PROC_MIGRATE_MST_FRM_ORA_SQLSERVER,
Line 43
The operation could not be performed because OLE
DB provider "OraOLEDB.Oracle" for linked server "ORCL" was unable to begin a distributed transaction. -
I have a labview sub-VI reading the string being outputted by a pH meter. The meter outputs a 5 line string and labview is only reading up to each lines carriage return, there-by giving me 5 separate strings is there anyway to rectify this and have the 5 line read as one string?
NAS1
St Petersburg FL
Labview 2010Yes, LabVIEW will automatically update. What happens is that the old serial functions still exist in 7.1 and above but the code (the block diagram) has been modified to use VISA functions. Older versions of LabVIEW are fully supported in this manner. The only way you can avoid the automatic update is to have the old serial functions in an llb and your top level VI refer to these. Having any VI that was part of vi.lib in an llb is a very bad idea and the way to fix things is to remove any VIs in the llb that are part of the LabVIEW distribution.
I don't remember how the old serial config worked and what the new version does with the VISA Configure Serial Port. Your program should only have a single serial config and you might just be able to directly replace that with the VISA configure Serial Port.
Maybe you are looking for
-
Tabs on top with Safari in 10.6 at last
A hint at macosxhints.com that shows us how to use the older beta in 10.6; http://www.macosxhints.com/article.php?story=20090925131057394 Enjoy, Rob
-
Driver for 40Y8686 CD-RW/DVD-ROM Combo II Drive
For the life of me, I cannot find this driver for download from the web site. Any pointers would be GREATLY appreciated!
-
UCCX 9.0 Priority Routing within Queue
Hello, I am setting up priority call queuing. Here is the call flow. Caller dial the number to the AA script. (see below) The customer selections the option 2 and routes to the queuing script via a call subflow. The subflow script queues to one CSQ
-
Brightness very high in video store purchases?
I use iTunes only to buy music and just now decided to try a video, I have the player installed for Windows 7. For some reason, the videos I download seems to have a very high brightness setting. Since the iTunes player doesn't seem to have a way of
-
I'm trying to transfer a quicktime file, when I drop the file in my hard drive I get the following error message "The operation can be completed because an unexpected error occured (error code 0). It only happens with this particular drive.