Read a barcode(including line feeds) into text item
When I scan a bar code from a text item, I am unable to retrieve line feeds that are in a barcode. I need line feeds to retrieve various values encoded in the barcode. When I scan the same code on a notepad, I get output in multi-lines. But, oracle forms is removing the line feeds when I scan barcode in a text item. Please advice. Forms Version is 10g
It gave me output of 10.
Original string looks like this with control charactes <LF> and <CR>.
@<LF><CR>ansi 636049030002dl00410466zn05070057dldcabcde<LF>dcbbcdefjklmw
I have to get hold of <LF> character because it is used as delimiter for data values in barcode. But, when I scan it in oracle forms item, it is not reading <LF> character. Based on what you suggested, using dump and ascii, it ilooks like it is reading carriage return <CR> as CHR(10) and not <LF>. There is one more <LF> in the string and forms text item is not recognizing it. Dump output is shown below:
@,^J,A,N,S,I, ,6,3,6,0,4,9,0,3,0,0,0,2,D,L,0,0,4,1,0,4,6,6,Z,N,0,5,0,7,0,0,5,7,D,L,D,C,A,B,C,D,E,D,C,B,B,C,D,E,F,J,K,L,M,W,
Thanks
Similar Messages
-
Best way to remove last line-feed in text file
What is the best way to remove last line-feed in text file? (so that the last line of text is the last line, not a line-feed). The best I can come up with is: echo -n "$(cat file.txt)" > newfile.txt
(as echo -n will remove all trailing newline characters)What is the best way to remove last line-feed in text file? (so that the last line of text is the last line, not a line-feed). The best I can come up with is: echo -n "$(cat file.txt)" > newfile.txt
(as echo -n will remove all trailing newline characters)
According to my experiments, you have removed all line terminators from the file, and replaced those between lines with a space.
That is to say, you have turned a multi-line file into one long line with no line terminator.
If that is what you want, and your files are not very big, then your echo statement might be all you need.
If you need to deal with larger files, you could try using the 'tr' command, and something like
tr '
' ' ' <file.txt >newfile.txt
The only problem with this is, it will most likely give you a trailing space, as the last newline is going to be converted to a space. If that is not acceptable, then something else will have to be arranged.
However, if you really want to maintain a multi-line file, but remove just the very last line terminator, that gets a bit more complicated. This might work for you:
perl -ne '
chomp;
print "
" if $n++ != 0;
print;
' file.txt >newfile.txt
You can use cat -e to see which lines have newlines, and you should see that the last line does not have a newline, but all the others still do.
I guess if you really did mean to remove all newline characters and replace them with a space, except for the last line, then a modification of the above perl script would do that:
perl -ne '
chomp;
print " " if $n++ != 0;
print;
' file.txt >newfile.txt
Am I even close to understanding what you are asking for? -
Can I include a logo into text module in smart forms
Hi,
I want to know whether I can include a logo into text module or not in smart forms.
Pls some one assist me.
Regards,
ChandraHi,
No you cannot attach a logo in Text Module because it can store only text, and your logo is stored in presentation server so it cannot be used aywhere else.I hope your question is answered.
Regards. -
Difference between Two Date Should come into Text Item
Dear All,
i want to get difference between two date into text Item :P36_C in On Change java script.
i have two Date Item :P36_A and :P36_B .i have extract these date value from table then difference comes into Text Field :P36_C.
Now i want if i change Date into Item :P36_A or Item :P36_B then Defference between two date Should Come into Item :P36_C .
So i have use Java Script Code to do this
<script>
function diffdat(){
function getVal(item){
if($x(item).value != "")
return parseFloat($x(item).value);
else
return 0;
$x('P36_C').value =
getval((TO_DATE('P36_B', 'DD-MON-YYYY'))-
getval(TO_DATE('P36_A', 'DD-MON-YYYY')))+1;
</script>
i have put this into Item HTML Form Element Attributes
onChange="javascript:diffdat();"it's not woring .
How to work that Code with dates.
ThanksYou can always create your own difference function based on your own criteria. You can modify this to suit your needs.
CREATE OR REPLACE FUNCTION CALC_OFFICE_DAYS(date1 DATE, date2 DATE)
RETURN NUMBER
IS
v_begin_date DATE := date1;
v_end_date DATE := date2;
v_office_start_time VARCHAR2(10) := '09:30 AM';
v_office_end_time VARCHAR2(10) := '06:30 PM';
v_comp_begin_time DATE;
v_comp_end_time DATE;
v_days PLS_INTEGER := 0;
v_hrs NUMBER := 0;
v_ttltm NUMBER;
BEGIN
select trunc(v_end_date) - trunc(v_begin_date)
into v_days
from dual;
select to_date(to_char(sysdate,'DD-MM-YYYY')||' '||to_char(v_begin_date,'HH24:MI'),'DD-MM-YYYY HH24:MI')
into v_comp_begin_time
from dual;
select to_date(to_char(sysdate,'DD-MM-YYYY')||' '||to_char(v_end_date,'HH24:MI'),'DD-MM-YYYY HH24:MI')
into v_comp_end_time
from dual;
select (v_comp_end_time - v_comp_begin_time)/24 into v_hrs from dual;
IF v_hrs > 4 then
v_ttltm := v_days + .5;
ELSE
v_ttltm := v_days;
END IF;
return v_ttltm;
END;
As has been noted, this question is best posted on the PL/SQL forum. -
Problems Typing into Text Items
I HAVE PROBLEMS WHEN I'M TYPING STRINGS INTO TEXT ITEMS, IT IS WHEN TYPING SPACE BAR BETWEEN THE WORDS THE CURSOR MOVES FROM THE BEGINNIG OF THE TEXT. I SET THE PROPERTY KEEP CURSOR TO "YES" AND THE CURSOR MOVES FROM THE LAST OF THE TEXT, IGNORING THE SPACE BAR.
IT ALSO HAPPENS WHEN I'M WORKING WITH DATETIME ITEMS.
ANYONE CAN TELL ME HOW TO SOLVE IT ?.
THANKS.
nullIf u r using Oracle Developer 6 then you need to apply the patches . The latest patch is Patch6a.
These patches will fix the bugs u have reported plus many more in Forms 6.
Thanks.
Thiru -
Insert hyperlink into Text Item
I'm looking to create a footer text item for all reports that has a link that will launch an email to the BI team. I was able to find some javascript that I can use to launch Outlook but I can only get it to work with a button item or link item. I can't seem to figure out how to insert it into a Text Item.
What I want is:
"If you have any question please contact BI Team"
where BI Team is the link.
Thanks.Hi,
i hope you want this functionality in WAD report. have u tried "HREF" in HTML code of WAD for that link.
for example: you want to open the link on clicking on "BI Team" so write a code in WAD like this
"If you have any question please contact <a href="http://mail.google.com/" target="_blank" >BI team</a>
Hope this will solve you query
Thanks,
Om Ambulker -
Folder action to find and replace text and change line feeds
I want to use a folder action to find and replace text and change Mac carriage returns to DOS line feeds inside text files.
The text to be replaced is: "/Users/wim/Music/iTunes/iTunes Music/Music" (without the quotes)
This text has to be removed (i.e. replaced by an empty string)
The text occurs many times within each file.
The files are playlists exported from iTunes in the M3U format (which are text files). They contain Mac carriage returns. These need to be changed to DOS line feeds.
I have found the following two perl commands to achieve this:
To find and replace text: perl -pi -w -e 's/THIS/THAT/g;' *.txt
To change carriage returns to line feeds: perl -i -pe 's/\015/\015\012/g' mac-file
I know that it's possible to make a folder action with Automator that executes a shell script.
What I want to do is drop the exported playlists in M3U format in a folder so that the folder action will remove the right text and change the carriage returns.
My questions are:
Is it possible to make a folder action that executes command line commands instead of shell scripts?
What is the correct syntax for the two commands when used in a folder action shell script? Especially, how do I escape the slashes (/) in the string to be removed?
Thanks for your helpOk, I've include an applescript to run a shell command. The applesript command quoted form makes a string that will end up as a single string on the bash command line. Depending on what you want to do, you may need multiple string on the bash command lines. I've included some information on folder actions.
It is easier to diagnose problems with debug information. I suggest adding log statements to your script to see what is going on. Here is an example.
Author: rccharles
For testing, run in the Script Editor.
1) Click on the Event Log tab to see the output from the log statement
2) Click on Run
For running shell commands see:
http://developer.apple.com/mac/library/technotes/tn2002/tn2065.html
on run
-- Write a message into the event log.
log " --- Starting on " & ((current date) as string) & " --- "
-- debug lines
set desktopPath to (path to desktop) as string
log "desktopPath = " & desktopPath
set unixDesktopPath to POSIX path of desktopPath
log "unixDesktopPath = " & unixDesktopPath
set quotedUnixDesktopPath to quoted form of unixDesktopPath
log "quoted form is " & quotedUnixDesktopPath
try
set fromUnix to do shell script "ls -l " & quotedUnixDesktopPath
display dialog "ls -l of " & quotedUnixDesktopPath & return & fromUnix
on error errMsg
log "ls -l error..." & errMsg
end try
end run
How to set up a folder action.
1) right click on folder. click on Enable folder actions
2) Place script in
/Library/Scripts/Folder Actions Scripts
3) right click on folder. click on attach folder action
pick your script.
Create a new folder on the desktop & try.
You can put multiple folder actions on a folder. There are other ways of doing this.
Here is my test script:
on adding folder items to this_folder after receiving dropped_items
repeat with dropped_item_ref in dropped_items
display dialog "dropped files is " & dropped_item_ref & " on folder " & this_folder
end repeat
end adding folder items to
How to make the text into an AppleScript program.
Start the AppleScript Editor
/Applications/AppleScript/Script Editor.app
In Snow Leopard it's at: /Applications/Utilities/AppleScript Editor
Copy the script text to the Applescript editor.
Note: The ¬ is typed as option+return. ption+return is the Applescript line continuation characters.
You may need to retype these characters.
Save the text to a file as an script and do not check any of the boxes below. -
I want to read the contents of a file to a text item line by line dynamical
I have created a timer
tm_id := FIND_TIMER('LOG_READING_TIMER');
If Id_Null(tm_id)
then
tm_id := create_timer('LOG_READING_TIMER', 1000, REPEAT);
else
set_timer (tm_id, 1000, REPEAT);
end if;
/* executed the shell script on application server */
host(v_command,no_screen);
and used below code for reading a file in when timer expired
DECLARE
v_file_name := '/home/log.txt' /* log created during running shell script */
BEGIN
v_infile := Text_IO.Fopen(v_file_name , 'r');
loop
Text_IO.Get_Line(v_infile,v_linebuf);
:CONTROL.item:= :CONTROL.item||v_linebuf||chr(10);
end loop;
WHEN no_data_found THEN
Text_IO.Fclose(v_infile);
delete_timer('LOG_TIMER');
END
I want to read a log file which is created while runnning shell script line by line
dynamically
Above code is reading the log filebut all the lines are shown at once.
I have to display
each line on the text item
and the next line line by line
Can anyone help me how to achieve this.
Thanks,
in advanceIn when-button-pressed trigger
I have called a shell script on application server using host command
HOST('Path of script',NO_SCREEN);
Shell script writes some set of statements to log file on application server
Problem is to read the log file on to the multiline text item each line simultaneosly
while running the script.
Below is the procedure i have written to achieve this but below code is writing all the lines at once
after entire complete execution of shell script.
for example
shell script writes tolog file:
1. 'Loading of tables';
then loads the data
2. 'emailing data';
3. ...
4. ...
Below code writes
all the 4 lines at once
I want to see in frontend what is going on while running the script
by reading the log file data line by line
WHEN-BUTTON-PRESSED
tm_id := FIND_TIMER('LOG_READING_TIMER');
If Id_Null(tm_id)
then
tm_id := create_timer('LOG_READING_TIMER', 1000, REPEAT);
else
set_timer (tm_id, 1000, REPEAT);
end if;
/* executed the shell script on application server */
host(v_command,no_screen);
WHEN-TIMER-EXPIRED
and used below code for reading a file in when timer expired
DECLARE
v_file_name := '/home/log.txt' /* log created during running shell script */
BEGIN
v_infile := Text_IO.Fopen(v_file_name , 'r');
loop
Text_IO.Get_Line(v_infile,v_linebuf);
:CONTROL.item:= :CONTROL.item||v_linebuf||chr(10);
end loop;
WHEN no_data_found THEN
Text_IO.Fclose(v_infile);
delete_timer('LOG_TIMER');
END
While running the script on application server
I want to see the data from log file simulataneously on to the form when the data is written on to the log file
Please let me know if you need more details.
Thanks,
in advance -
How to find number of lines in the text content?
Hello All,
I have a multi line text item. I want to know the number of lines in a text item? How can I do that?
Note that every lines end with the shift+enter.
Example,
This is a
sample.
After line This is a there is (Shift + Enter).
Thanks for any help.Whenever the user inputs Shift-Enter, Photoshop inserts an [EOT] (End Of Text) control character (\x03 or \u0003) in the string.
Also, in order to split the text according to multiple separators in only one call, it is necessary to use a regular expression instead of a string.
Try replacing:
var theArray = theText.split("\r");
with:
var theArray = theText.split(/[\u0003\r]/);
BTW, you can improve performance by explicitely requesting the textKey property of the current layer object.
Try using:
ref.putProperty( charIDToTypeID("Prpr"), stringIDToTypeID("textKey") );
ref.putEnumerated( charIDToTypeID("Lyr "), charIDToTypeID("Ordn"), charIDToTypeID("Trgt") );
instead of:
ref.putEnumerated( charIDToTypeID("Lyr "), charIDToTypeID("Ordn"), charIDToTypeID("Trgt") );
HTH... -
How to write to multiple lines in text item?
I tried to write 2 lines in the text item, however only return one line:
:myqueues.queue := 'hello' || chr(10) ||'world';
It gives me only 'hello' in the first line and nothing else in the 2nd line.
Is there any settings needs to be activated in the property of text item?I'm reading a file and imports the strings:
DECLARE
v_filename VARCHAR(50);
v_handle text_io.file_type;
readline varchar(50);
BEGIN
v_filename := get_file_name(file_filter=>'All files(*.*)|*.txt|');
v_handle := text_io.fopen(v_filename, 'r');
text_io.get_line(v_handle, readline);
:myqueues.queue := rtrim(readline);
text_io.get_line(v_handle, readline);
:myqueues.queue := :myqueues.queue || chr(10) || rtrim(readline) ;
text_io.get_line(v_handle, readline);
:myqueues.queue := :myqueues.queue || chr(10) || rtrim(readline) ;
text_io.get_line(v_handle, readline);
:myqueues.queue := :myqueues.queue || chr(10) || rtrim(readline) ;
text_io.fclose(v_handle);
END;
This function reads the file and returns 4 strings, each of which takes one line in one record of text item.
My question is: can I get 4 records, assigning each with one string from the input file?
Thanks a lot. -
"Enter" in a multi-line text item (Urgent)
Hello,
I am using developer 6i.
I have a text item on my form with the following properties:
Height = 100
width = 100
Multiline = True
Now i am assiging a value to this text item programatically.
I want to show the data assigned to this field in the same pattern as written below:
Name: Imran Baig
Age: 27
Email: misterimran@hotmail.
Now how to show Age:27 on the next line of the text item, i am using chr(13) but its not working, is there any other way to do this???
Please help and its also urgent!
Thanks a lot
ImranHello,
Use CHR(10) instead of CHR(13)
Francois -
Problem with multiline text item return on query
Hi there, I am a beginner in ORACLE, here when i write a query i engaged a weird problem,
LOOP
FETCH CSR_ODR2 INTO :ORDER_RECORD.OREDER_RECORD_NO,:ORDER_RECORD.BILL_NO,:ORDER_RECORD.ACTUALO_WEIGHT,:ORDER_RECORD.OPERATION,:ORDER_RECORD.PLACE,:ORDER_RECORD.TRANSACTION_DATE,:ORDER_RECORD.ORDER_NO;
EXIT WHEN CSR_ODR2%NOTFOUND;
END LOOP;
this is the cursor version, I also tried SELECT statement, but have trouble about return more than 1 row.
:Order_Record is a detailed-form with multiline text items,while execute this cursor, it always rewrite the 1st line and wont go to 2nd line, I wanna get some help about how to display different records in different line in a text item.
btw, i tried next_record,next_item,next_field, but none of them works, the query is based on the record i filled on the master form, and show related record in detailed-form
Kyle
Edited by: user12234866 on 13-Jun-2010 00:32DECLARE
CURSOR CSR_ORDER IS
SELECT T.ORDER_DATE,T.WEIGHT,T.CUSTOMER,T.DRIVER_NO,T.INVOICE_NO,T.LICENSE_NR_TRUCK,T.PRODUCT,T.PRICE_PER_TON,T.TRAILER_NO
FROM TRANSPORT_ORDER T
WHERE T.ORDER_NO=:TRANSPORT_ORDER.ORDER_NO;
BEGIN
OPEN CSR_ORDER;
LOOP
FETCH CSR_ORDER INTO :TRANSPORT_ORDER.ORDER_DATE,:TRANSPORT_ORDER.WEIGHT,:TRANSPORT_ORDER.CUSTOMER,:TRANSPORT_ORDER.DRIVER_NO,:TRANSPORT_ORDER.INVOICE_NO,:TRANSPORT_ORDER.LICENSE_NR_TRUCK,:TRANSPORT_ORDER.PRODUCT,:TRANSPORT_ORDER.PRICE_PER_TON,:TRANSPORT_ORDER.TRAILER_NO;
EXIT WHEN CSR_ORDER%NOTFOUND;
END LOOP;
END;
DECLARE
CURSOR CSR_ODR2 IS
SELECT O.OREDER_RECORD_NO,O.BILL_NO,O.ACTUALO_WEIGHT,O.OPERATION,O.PLACE,O.TRANSACTION_DATE,O.ORDER_NO
FROM ORDER_RECORD O
WHERE O.ORDER_NO=:TRANSPORT_ORDER.ORDER_NO
ORDER BY OREDER_RECORD_NO asc;
BEGIN
OPEN CSR_ODR2;
GO_BLOCK(':ORDER_RECORD');
LOOP
FETCH CSR_ODR2 INTO :ORDER_RECORD.OREDER_RECORD_NO,:ORDER_RECORD.BILL_NO,:ORDER_RECORD.ACTUALO_WEIGHT,:ORDER_RECORD.OPERATION,:ORDER_RECORD.PLACE,:ORDER_RECORD.TRANSACTION_DATE,:ORDER_RECORD.ORDER_NO;
EXIT WHEN CSR_ODR2%NOTFOUND;
END LOOP;
END;
thats the stuff i wrote here to execute -
How to insert values using pushputtons in text item & fetch data based on
Dear friends,
I want to insert values in the Text item using pushbutton e.g to insert 05CST884 into text item using pushbuttons '0' '5' 'C' 'S' 'T' '8' '8' '4' (alpha numeric buttons) in the layout editor and then fetch data based on the number entered with that of one in the table in the another text item2 in the layout editor.
Suggestions regarding how to develop and use effective triggers are welcome.At the block level (for the control block where all your push buttons are, let's call it block1) create a WHEN-BUTTON-PRESSED trigger. Your [A-Z] and [0-9] buttons should be on a dedicated non-database datablock to reduce problems. As stated previously, this trigger should just contain the code:
:block2.text_item := :block2.text_item||get_item_property(:system.trigger_item, label);
Also on the pushbutton block, create a backspacve button with its own dedicated WHEN-BUTTON-PRESSED trigger containing:
if length(:block2.text_item) > 0 then :block2.text_item := substr(:block2.text_item, 1, length(:block2.text_item)); end if;
This will hopefully erase the last character entered.
block2 should be based on the database table (see Property Palette --> Database) you wish to query and text_item should be based on the database item which contains the code you entered. All the other database items you wish to displayshould also be added to block2.
Add another FIND push button to block1 with the code:
go_block('block2');
execute_query;
Without writing the whole thing for you, I'd suggest you get a decent Forms tutorial book to guide you through the basics (Oracle Forms Developers Handbook). -
Reading one line from a text file into an array
i want to read one line from a text file into an array, and then the next line into a different array. both arays are type string...i have this:
public static void readAndProcessData(FileInputStream stream){
InputStreamReader iStrReader = new InputStreamReader (stream);
BufferedReader reader = new BufferedReader (iStrReader);
String line = "";
try{
int i = 0;
while (line != null){
names[i] = reader.readLine();
score[i] = reader.readLine();
line = reader.readLine();
i++;
}catch (IOException e){
System.out.println("Error in file access");
this section calls it:
try{
FileInputStream stream = new FileInputStream("ISU.txt");
HighScore.readAndProcessData(stream);
stream.close();
names = HighScore.getNames();
scores = HighScore.getScores();
}catch(IOException e){
System.out.println("Error in accessing file." + e.toString());
it gives me an array index out of bounds erroroh wait I see it when I looked at the original quote.
They array you made called names or the other one is prob too small for the amount of names that you have in the file. Hence as I increases it eventually goes out of bounds of the array so you should probably resize the array if that happens. -
When I copy and paste text in facebook, the text looks fine until I hit 'share' or 'comment' to submit it. Firefox then adds indiscriminate line-feeds within the text and it looks nothing like the original text. It makes it very difficult to read and awful to look at.
This does not happen in Safari.
(Mac OSX 10.6.4 with Firefox 3.6.6).
== URL of affected sites ==
http://Same problem, 3.6.8 and previous recent versions. I never thought to try another browser but I just pasted into IE and it worked fine. I copied from Firefox to IE and it worked as well. It's just when you paste into Firefox that you get the weird line breaks.
Maybe you are looking for
-
HP Color LaserJet CP2025dn Printer
I just bought this printer but am unable to get it calibrated properly - it doesn't print with any black in colour files? Why does black only show up on text files?
-
I'm looking for a plug-in or software/hardware that will let me capture video into premiere CS-5 as a .mp2 or .mpg file on a PC (actually a laptop). I don't want to have to encode, but just have the raw captured file be an .mp2. Any ideas?
-
Problems With 4K at 60fps & a High-End Graphics Card
I'm having major problems editing footage shot at 3840x2160 @ 59.94. The video will play back fine initially, but after a few seconds, the video starts chugging along until I get less than 1fps. I have the same problem using adaptive resolution durin
-
I have an original TV Anywhere card, not master. I have the latest drivers which suck as it is. I recently installed xpsp2 and installed the drivers and the pvr program. The drivers install fine, but when I load the pvs program all it does is cras
-
Updated to mac mini 2012, 4G ram. OSX 10.0.1 imovie 10. Importing video from canon hv20 with firewire 800 and clip is all choppy though tape is fine. Previous I used iMac 2006, imovie9 with fw 400 connection and import was fine.