How to tokenize the unicode text into single word stream ?
i am a newer to java, trying a toy program
e.g a% #unicode --> a unicode
ansi txt successeed
but unicode txt parse result �F a u n i c o u d e
how can i parse the unicode txt into single word by streamTokenizer?
thanks!
import java.io.*;
//import java.util.*;
public class Test
public static void main(String[] args)
try
BufferedReader r = new BufferedReader (new FileReader("ansiIn.dat"));
StreamTokenizer st = new StreamTokenizer(r);
st.lowerCaseMode(true);
st.whitespaceChars('\u0000', '\u0040');
st.whitespaceChars('\u005B', '\u0060');
st.whitespaceChars('\u007B', '\u00FF');
while(st.nextToken() != StreamTokenizer.TT_EOF)
String token = st.toString();
System.out.println(token);
catch(IOException exception)
exception.printStackTrace();
}
copy to clipboard
run this script
--[SCRIPT]
set leTexte to the clipboard as text
set leTexte to my remplace(leTexte, " :", ":")
set leTexte to my remplace(leTexte, space, tab)
set deci to character 2 of (0.5 as text)
set leTexte to my remplace(leTexte, ".", deci)
set the clipboard to leTexte
--=====
on remplace(t, d1, d2)
local l
set AppleScript's text item delimiters to d1
set l to text items of t
set AppleScript's text item delimiters to d2
set t to l as text
set AppleScript's text item delimiters to ""
return t
end remplace
--=====
--[/SCRIPT]
paste where you want.
The last call to the 'remplace' handler is used to replace the decimal period by the decimal char in use (here it is comma)
Yvan KOENIG (from FRANCE jeudi 9 avril 2009 12:25:19)
Similar Messages
-
Automatically copy only the unicode-Text from a Word-Document into FM8
In my daily work I often have the problem to copy and paste text from a Word-Document or other documents into my FrameMaker documents.
The common way is to copy it in Word and "Special Paste" it in FrameMaker 8 as unicode. But this is not as confortable as to shortly hit Ctrl-v on the keyboard.
I would like to have a new menuitem to special paste only the unicode text from the clipbopard. Is there a way to make such a makro and to put it in the menubar with a Key-Trigger?
I read something like that in http://www.rzg.mpg.de/from_external/Frame6_Handbuch/Setting_up_FrameMaker.pdf (german), but I actually don't know what to chage for my case.Rather than create a new menu item (possible, I gather, but fiddly) I would recommendchanging the default “paste” behaviour.
In the MAKER.INI file there is a line beginning
ClipboardFormatsPriorities=
Change this to put UNICODE TEXT as the first item.
Ctrl-v will then paste Unicode text by default. You can still access the other options, should you need to, by using Paste Special. -
How to get the long text into text area
Hi,
save_text is working fine .
Now I want to display the text in text area .
am using read_text fm for this and data is coming into the internal table of the function module.
how shd I display that long text into text area and that text shld appear has display mode only and how shd I make all other fields in my subscreen as display mode.
Pls guide me its urgent.
thanks,
krishnaHai.
check this.
Long Texts are stored in tables
STXH - header
STXL - details.
if you want to read the texts you can use Fun Module READ_TEXT
Any Application document Header and Item Long texts are stored in STXH table with the 4 parameters OBJECT,ID,NAME and LANG
These texts are fetched from database using READ_TEXT fun module by passing the above 4 parameters.
Double click on the text, from the text editor menu GOTO-> HEDAER
you will find the all above 4 parameters
so accordingly you have to pass to the fun module READ_TEXT to fetch the texts.
example:
Re: upload longtext from excel file
REPORT zupload_excel_to_itab.
TYPE-POOLS: truxs.
PARAMETERS: p_file TYPE rlgrap-filename.
TYPES: BEGIN OF t_datatab,
col1(30) TYPE c,
col2(30) TYPE c,
col3(30) TYPE c,
END OF t_datatab.
DATA: it_datatab type standard table of t_datatab,
wa_datatab type t_datatab.
DATA: it_raw TYPE truxs_t_text_data.
At selection screen
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
CALL FUNCTION 'F4_FILENAME'
EXPORTING
field_name = 'P_FILE'
IMPORTING
file_name = p_file.
*START-OF-SELECTION.
START-OF-SELECTION.
CALL FUNCTION 'TEXT_CONVERT_XLS_TO_SAP'
EXPORTING
I_FIELD_SEPERATOR =
i_line_header = 'X'
i_tab_raw_data = it_raw " WORK TABLE
i_filename = p_file
TABLES
i_tab_converted_data = it_datatab[] "ACTUAL DATA
EXCEPTIONS
conversion_failed = 1
OTHERS = 2.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
END-OF-SELECTION.
END-OF-SELECTION.
LOOP AT it_datatab INTO wa_datatab.
WRITE:/ wa_datatab-col1,
wa_datatab-col2,
wa_datatab-col3.
ENDLOOP.
refards.
sowjanya.b -
How to merge the pdf files into single pdf?
I need to merge the two (or) three pdf files into a single pdf via scripting. I used the below code for inserting(merging) the pages.
this.insertPages({cPath: "Test.pdf"})
But its merginging(inserting) successfully. But the links not working after inserting. kindly advise me the solution or any other ways.
I am using Acrobat 8.0.
Thanks in advance..http://gotofritz.net/blog/howto/joining-pdf-files-in-os-x-from-the-command-line/ <- this works but it strips OPI
Here's what I did: (This is shell script)
#!/bin/bash
FROM="./"
DESTINATION="./unCombined/"
for i in $(ls *_F_ga.pdf)
do
BACK=`echo "$i" | sed "s/_F_/_B_/g"`
if [ -f $BACK ] ; then
open "$i"
osascript selectMenuItem.scpt
sleep 3
mv -f "$FROM/$i" $DESTINATION
mv -f "$FROM/$BACK" $DESTINATION
fi
done
This calls an applescript
tell application "/Applications/Adobe Acrobat X Pro/Adobe Acrobat Pro.app"
activate
end tell
tell application "System Events"
tell process "Acrobat"
click menu item "combine Front and Back" of menu "File" of menu bar 1
end tell
end tell
Which activates a menu item (made with Java and saved into Macintosh\ HD/Users/*user*/Library/Application\ Support/Adobe/Acrobat/10.0/JavaScripts)
app.addMenuItem({
cName: "combineFB",
cUser: "combine Front and Back",
cParent: "File",
cExec: "combineFrontAndBack()",
nPos: 0
Which activates this script (again saved into Macintosh\ HD/Users/*user*/Library/Application\ Support/Adobe/Acrobat/10.0/JavaScripts)
combineFrontAndBack = app.trustedFunction(
function(){
// get the file name and extension
var sFullFileName = this.documentFileName
// make into an arry
var aFullFileName = sFullFileName.split('_F_');
// build a file name array dropping the extension
var aFileName = new Array(aFullFileName.length - 2);
for (i = 0; i < aFullFileName.length - 1; i++) {
aFileName[i] = aFullFileName[i];
// recreate file name
var sFileName = aFileName.join('.');
var back = sFileName + "_B_ga.pdf";
app.beginPriv(); // Explicitly raise privilege
//add back page based on front page name
this.insertPages ({
nPage: 0,
cPath: "/Macintosh HD/Users/jfox/test/" + back,
nStart: 0
this.saveAs("/Macintosh HD/Users/jfox/test/" + sFileName + "_ga.pdf");
this.closeDoc(true);
app.endPriv();
return true;
It's convoluted and comparitively slow, but it works.
EDIT: I just realized you probably meant document links and not OPI links. Ha ha. I have no Idea what this would do to document links. -
How to download the Dynamic data into PPT format
Hi Friends,
I have one doubt on WDJ. How to download the Dynamic data into PPT format. For Example Some Dynamic data is available in to View in that One Download Link or button available. Click on Download link or button download that data into PPT Format
Is it possible for WDJ. If possible please tell me.
Or
How to create Business Graphics in Web Dynpro Applications depening up on Excel Data and finally we can download the Business Graphics into powerpoint presentation.
Thank you,
Regards
Vijay Kalluri
Edited by: KalluriVijay on Mar 11, 2011 6:34 AMHi Govindu,
1. I have one doubt on WDJ. Click on either Submit Buttion or LinkToURL UI we can download the file that file having ppt formate(Text.PPT).
I am using NWDS Version: 7.0.09 and Java Version: JDK 1.6
2. is it possible to download the business Graphics in to the PPT by using Java DynPro
Regards
VijayK -
How to import the internal table into subroutine as parameter
how to import the internal table into subroutine as parameter, and its structure can be recognized inside the subroutine
Hi Yong,
try this:
parameters: p_tabnm like dd03l-tabname.
field-symbols: <fs_tabname> type standard table.
data: itab_ref type ref to data.
create data itab_ref type standard table of (p_tabnm)
with default key.
assign itab_ref->* to <fs_tabname>.
select * from (p_tabnm) into table <fs_tabname>.
perform subroutine tables <fs_tabname>
using p_tabnm.
*& Form subroutine
text
-->P_<FS_TABNAME> text
-->P_P_TABNM text
form subroutine tables p_tabname type standard table
using p_tabnm.
Here p_tabname already has the structure of the table you gave as input
parameter
endform. " subroutine -
How to load the certificate authority into the keystore for the weblogic8.1
how to load the certificate authority into the keystore for the weblogic8.1
==================================================
Getting the message below when trying to improt the certificate to the weblogic 8.1 web server. Received this certificate from our internal IT certificate authority. Trying to import the certificate to our test sytem.
===================================================
keytool error: java.lang.Exception: Failed to establish chain from reply
Import failed. Verify that the Certificate Authority that signed 'certi.pem'
has been loaded into your keystore 'keystore\pskey'
To view keystore contents issue 'PSkeymanager -list -keystore keystore\pskey [-v
To preview a certificate file issue 'PSkeymanager -previewfilecert -file certi.pem'You need to populate that field using cmod code. Find out from which table that field is and go to transaction cmod then enter project name and select component radio button then display.
Now select the FM EXIT_SAPLRSAP_001 if your datasource is transactional dataource
EXIT_SAPLRSAP_002 for master data attibute
EXIT_SAPLRSAP_003 for Hierarchies
EXIT_SAPLRSAP_004 for text
then populate code .
After your code then delete data from ods then reinit to populate the enhanced field.
Hope it helps.. -
How to change the default text title of Detached table/treetable
Hi,
Is anybody know How to change the default text title of Detached table/treetable.
I have already read the post on "http://vtkrishn.com/2010/07/28/how-to-change-the-default-text-title-of-detached-tabletreetable/"
as per this post It will change the title throughout the application.
I wanted to change only for one particular table.
Thanks,
Charu
Edited by: Charu on Sep 13, 2012 4:14 AMHi,
please don't double post and instead continue with your original threat. In the previous post you got the correct answer to use skinning. You did not like the solution as it doesn't allow per-instance titles. I agree with this and a logical consequence is to file an enhancement request instead of re-posting the question. I'll file the ER, so no need to follow up for you anymore
Frank -
How to set the default text in an input box or a label to be a predefine, multiline text
how to set the default text in an input box or a label to be a predefine, multiline text. In other words how to break the line in the code of a text box.
thank youThere are a couple of ways of doing this:
If you're editing on the canvas, press Shift + Enter.
If you're working in Express View (see lower right hand corner of Project Siena), you'll need to copy a hard return from another app such as Notepad.
I believe a better implementation of hard returns are in the list of requested functionality that you can find here:
https://social.technet.microsoft.com/Forums/en-US/2e1f9446-56b2-419a-9c17-7037d2cd6146/from-the-community-overview-of-requested-additional-functionality?forum=projectsiena
Thor -
How to get the short text in tcode "msc3n" -- Basic data 2 -- short text.
I have to display the short text in my report output.
How to get the short text in tcode "msc3n" ( msc3n --> Basic data 2 --> short text.)?
Is there any function module availble to get this short text or is this stored in any data base table ?
Please help me. Your help will be highly appreaciated.
THANKS.Hi,
Use FM 'READ_TEXT' to get this values.
Say for exampele my material is 1900001 and batch is 0000000517.
Then my parameters to the FM will be as follows:-
Text Name 000000000001900001 0000000517
Language EN
Text ID VERM
Text Object CHARGE
This information you can get as follows.
Open the short text window in the text editor.
Here you can enter the long text.
In the editor Go to Header and you will find the details.
Please note that the text name will comprise of
Material
Batch
Plant
Stor. Location
if all the details are given.
I hope this helps you.
Regards,
Ankur Parab -
How to get the bold texts in JTextPane?
How to get the bold texts in JTextPane?
I believe you need to look at the Elements of the Document. Use the Document.getDefaultRootElement() method to get the first root Element. From there you can iterate through all the Elements. You should then be able to check the attributes of the element to see if it contains the Bold attribute using something like:
AttributeSet attributes = element.getAttributes();
if ( attributes.containsAttribute(StyleConstants.Bold, Boolean.TRUE)
// do processing here -
How to populate the Quering data into Excel sheet in Oracle
Dear Guys,
How to populate the Quering data into Excel sheet in oracle.
Please provide a solution.
Thanks & Regards,
Senthil K KumarHi
To make Excel sheets from sqlplus, you can use the markup html tag in sqlplus.
Here's an example.
Example
<code>
SET LINESIZE 4000
SET VERIFY OFF
SET FEEDBACK OFF
SET PAGESIZE 999
SET MARKUP HTML ON ENTMAP ON SPOOL ON PREFORMAT OFF
SPOOL c:\test_xls.xls
SELECT object_type
, SUBSTR( object_name, 1, 30 ) object
, created
, last_ddl_time
, status
FROM user_objects
ORDER BY 1, 2
SPOOL OFF
SET MARKUP HTML OFF ENTMAP OFF SPOOL OFF PREFORMAT ON
SET LINESIZE 2000 VERIFY ON FEEDBACK ON
</code> -
Hi, can anyone please tell me how to install the Nik collection into Adobe Photoshop CC 2014.2.1 ?
Glad I could help. Thanks for letting me know I did.
Gene -
How to put the alv output into the spool request?
Hi guys,
How to put the alv output into the spool request?
Thanks!Hi
Sending an ALV List screen output to SPOOL
Convert ALV list to PDF and send mails to respective persons
Regards
Pavan -
How to Extract the Highlight Text in PDF File
Hi Scripters,
i want know, how to extract the hightlight text in pdf files for text only format for (*.txt) file extension save.
regards
babyHi,
Okay i'll try do best.
thanks for your reply.
Regards
Baby
Maybe you are looking for
-
Hello, In FI, we have a datasource for Accounts Receivable Line Items 0FI_AR_04 that loads data from BSID(Open Items) and BSAD (Cleared Items) My question is how do I identify that the extractor has loaded from BSID or BSAD, I mean how do I know whet
-
Take a look at the attached .jpg below. I want to put an indicator in this frame which would allow me to know when data aquisition is occuring. Something like a LED on the front panel would be ideal. I just want something that, when viewed from the f
-
How do I transfer GB files with Real Tracks to Ext. HD?
When I try to transfer files that have real tracks in them to my external harddrive, Copy freezes. It freezes when it tries to copy something like "recording #15. aif" I'm guessing because it can't find that file? Any ideas? Also...this may be relate
-
Authorization Check Infotype Header
Hi all, i posted the following threat in HCM Forum, but i think it is also a question for ABAP Forum Authorization Check Infotype Header Thanks & regards
-
hi all, i have an ALV report, while executing in background one of the field length is 40 but it is displaying till 15 only. the code is as below loc_count = loc_count + 1. ls_fieldcat-fieldname = 'KTEXT'. ls_fieldcat-tabname = 'GT_LINE_ITEM1'. ls_fi