I want to open a txt file and output data through an AO-using DAQmx for PXI
I have a PXI running a 8145RT CPU. I have a PX6040E Multifunction DAQ card installed in the PXI. I want to program an application where I open a txt file (existing in one of the the RT machines' folders), read the first row, and output its data through an AO channel. The drivers I should use is DAQmx v7.1, and the Labview RT v.7
Any idea?
What exactly are you having problems with? Reading a text file can be done a number of ways. Look at the File I/O palette and check out Read Lines From File or Read Characters From File. There are string to number conversion functions on the string palette (i.e. Scan From String). There are also numberous shipping examples on using DAQmx for analog out. If you have a specific problem or question, please post back with additional details.
Similar Messages
-
I want to open a PDF file and i can't? any advice?
I want to open a PDF file and i can't? any advice?
Pages will not open a PDF file
It will export a file as PDF
See
Pages: Supported file formats - Apple Support -
Read from .txt file and output the content as two arrays
I am using the contoured move to control the x-y stage. The trajectory datas for x and y axis are generated using my interpolation program and it is stored in a .txt file as two columns. What I want to do is read .txt file and output the content of this file as two arrays. Is there anyone has any ideas? Thanks, the .txt file is attached.
Attachments:
R.75.txt 172 KBHi Awen,
This is quite easy to do, you can merely use the "read from spreadsheet file" function to get a 2D array (2 columns and n rows) and then use the index array function to get whatever row/colums you want..
Hope the attached VI helps you
When my feet touch the ground each morning the devil thinks "bloody hell... He's up again!"
Attachments:
read sprdsheet file.vi 27 KB -
Opening an .xls file and writing data to it....
Hi ,
I have written the following simple routine... which is supposed to open a .xls file and some data are written...:
DECLARE
application ole2.obj_type;
workbooks ole2.obj_type;
workbook ole2.obj_type;
worksheet ole2.obj_type;
worksheets ole2.obj_type;
cell ole2.obj_type;
--Declare handles to OLE argument lists
args ole2.list_type;
BEGIN
application:=OLE2.CREATE_OBJ('Excel.Application');
OLE2.Set_Property(application,'Visible', 'True');
workbooks := ole2.get_obj_property(application, 'Workbooks');
workbook:=OLE2.INVOKE_OBJ(workbooks,'Add');
args:= ole2.create_arglist;
ole2.add_arg(args, 'c:\example.XLS');
workbook := ole2.invoke_obj(workbook, 'Open', args);
ole2.destroy_arglist(args);
args:=OLE2.CREATE_ARGLIST;
OLE2.ADD_ARG(args, 1);
OLE2.ADD_ARG(args, 1);
cell:=OLE2.Invoke_Obj(workbooks, 'Cells', args);
OLE2.DESTROY_ARGLIST(args);
OLE2.Set_Property(cell, 'Value', 'Excel');
args := OLE2.CREATE_ARGLIST;
OLE2.ADD_ARG(args, 0);
OLE2.INVOKE(workbook, 'Close', args);
OLE2.DESTROY_ARGLIST(args);
OLE2.RELEASE_OBJ(cell);
OLE2.RELEASE_OBJ(workbook);
OLE2.RELEASE_OBJ(workbooks);
OLE2.RELEASE_OBJ(application);
OLE2.INVOKE(application,'Quit');
END; but it does nothing.... it simply opens the Excel application..... How should I modify the routine in order to open the example.xls file and write some data to it .....???????
Many thanks,
SimonOK... I SOLVED THE PROBLEM.....
Regards,
Simon -
Scanning .txt file and outputting results?
Greetings Everyone. My employer has charged me with a rather
confusing task. Basically I need to scan a .txt file and retrieve
some information from it. Here is a little background on the file
itself.
This is a feed file containing the information for employees
such as name, department, employement status etc...Zeros are used
in place of spaces in this file. What I am charged with is
retrieving the employment status and name for every single person
in the file (60,000+).
I need to write a coldfusion script that can do the
following.
1. Scan a .txt file that is sent to me every night and look
for the 99th character on each line of the .txt file
2. If the 99th character is a 'T' I need to pull characters
'10-50' (which contain the name for that person).
3. Output the results of the scan to a coldfusion page
displaying the individuals' names.
If anyone out there can point me in the right direction I
would be very grateful. I've been looking for websites on this
topic but I have been unsucessful so far. Should I post this in the
advanced section of the cf forums? Once again, thank you for any
help you can give me.I guarantee you can do this! And it shouldnt be to hard so
you can breath a sigh of relief... :)
I would use <cffile action="read" file="filepath/name.txt"
variable="fileContents">
Then you should be able to do something like <cfset
fileArray = ListToArray(fileContents, "#CHR(13)##CHR(10)#")>
Now you have an array so you can loop through and try
something like the following...
<cfloop index="i" from="1" to="#ArrayLen(fileArray)#"
step="1">
<cfif fileArray
NEQ "">
<!--- Find 99th Char --->
<cfset 99thchar = Mid(fileArray, 99, 1)>
<cfif 99thchar EQ "T">
<!--- Get Name --->
<cfset empName = Mid(fileArray
, 10, 40)>
<!--- Change 0's to Spaces--->
<cfset empName = Replace(empName, "0", "#CHR(32)#")>
<cfoutput>#empName#</cfoutput><br />
</cfif>
</cfif>
</cfloop>
That should be close to what you could use... You may have to
tweak it a bit... now if it is going though 60000+ records this may
take a while...lol You might have to use the cfsetting tag to
extend the normal request timeout..
Hope this helps! -
How to open an Excel file and write data into it.
Hi All,
I have an excel template, which has graphs and some tables containing corresponding data. If i change the data in tables it changes the graphs. So, if i have a template in the server, is it possible for me to open this excel file and change the data in the tables to chanage the graphs. How can i go to different worksheets and go to different cells and change the values and save the file.
Thanx in advance
Cheers
PejYou can setup an ODBC connection to the Excel file and update the file with JDBC, using the JDBC-ODBC bridge.
Hope this helps -
I want to open a .txt file in the Notepad editor
Dear all,
In my java program, when i click on a menu item, i need a .txt file to be opened in the notepad editor. Can someone please send to tell me how?
ThanksIs not very portable to specify the absolute path of notepad. If you pass the program to your friend it might not run!
I usually specify only the document.txt and the shell exe file (in windows xp cmd.exe), then the operating system think how to open the file. You can setting the operating system to open all the .txt file with notepad. It is very easy.
The your .txt document in your classpath, so is relative and not absolute.
Here the code:
String cmd = "cmd.exe /c start ";
String file = "mydocuemnt/manual.txt";
try {
Runtime.getRuntime().exec(cmd + (ClassLoader.getSystemResource(file)).toString());
} catch (IOException ee) {
JOptionPane.showMessageDialog(null, "The document dosn't exist!",
"Document not finded!", JOptionPane.ERROR_MESSAGE);
ee.printStackTrace();
} bye -
I want to open a text file and display it within Lookout 5.0
How do you read and display a text file within Lookout 5.0?
Hi Kenneth,
This should have been trivial, but isn't. Well, it isn't that difficult either. Here's the trick:
Create a DataSocket Object. For the URL, type: file:c:\ni\lookout5\test.txt[text]
Leave the Update mode as Automatic for now. Connect a Switch to the Connect member of the DataSocket object.
On the panel, drag-and-drop the DataSocket.data.txt. Toggle the Switch and voila you have the text in Lookout! I have attached an example (detach the txt file to your C drive; or change the path in the DataSocket object).
For the curious, DataSocket is a NI networking technology which supports ftp, http, file, and other protocols. See this
>FAQ f
or general info' on DataSockets.
Hope this helps,
Khalid
Attachments:
test.txt 1 KB
readtext.lks 2 KB -
Read from txt file and analyse data
hi,
i am having a problem for reading data from a text file and checking whether it is a integer or not.
basically if i have a txt file with the following content:
12 45 345 500 45.67684 33
my output should be:
12 45 345 500 invalid 33
that means if there is a integer number in the file, the integer number will be printed on the screen BUT if there is anything else like a string or a double number, then "invalid" will be printed.
how can i check what kind of datatype it is??
i have the following code to start with:
try
BufferedReader in = new BufferedReader(new FileReader(FileName));
String l = in.readLine();
in.close();
catch(IOException e)
System.out.println("IO error");
System.exit(0);
}ok i have tried the following code:
int index = 0;
String[] arr = null;
int nb = 0;
try
BufferedReader in = new BufferedReader(new FileReader(nameFile));
String line = in.readLine();
arr = line.split(" ");
for(int i=0; i<arr.length; i++)
index = i;
nb = Integer.parseInt(arr);
System.out.print(nb+" ");
in.close();
catch(IOException e)
System.out.println("IO error");
System.exit(0);
catch(NumberFormatException e)
System.out.print("invalid ");
for(int j=index+1; j<arr.length; j++)
nb = Integer.parseInt(arr[j]);
System.out.print(nb+" ");
which works perfectly fine for the following scenario:
txt-file:
12 45 345 500 45.67684 33
output:
12 45 345 500 invalid 33
but what, if I have the following data in my txt file:
12 45 345 500 45.67684 33 23.234 21
then the output should be:
12 45 345 500 invalid 33 invalid 21
how can i solve this??? -
Automator - Loop through a text file and process data through a 3rd party software
Just stumbled on Automator the other day (I am a mac n00b) and would like to automate the processing of a text file, line-by-line, using a third party tool. I would like Automator to loop through the text file one line at a time, copy the string and keep as a variable. Next, place the variable data (copied string) into the text field of the 3rd party software for processing. Once the processing is complete, I would like Automator to fetch the next line/string for processing. I see items like "copy from clipboard" and "variables" within the menu but I am not finding much documentation on how to utilizle this tool. Just hear how potentially powerful it is.
The 3rd party software is not a brand name, just something made for me to process text. I may have to use mouse clicks or tabs + [return] to navigate with Automator. A term I heard on Bn Walldie's itunes video series was "scriptable software" for which I don't think this 3rd party app would be.
Kind regards,
jwGood news and bad news...
The good news is that it should be entirely possible to automate your workflow.
The bad news is that it will be a nightmare to implement via Automator, if it's even possible.
Automator is, essentially a pretty interface on top of AppleScript/Apple Events, and with the pretty interface comes a certain stranglehold on features. Knowing how to boil rice might make you a cook, but understanding flavor profiles and ingredient combinations can make you a chef, and it's the same with AppleScript and Automator. Automator's good at getting you from points A to B but if there are any bumps in the road (e.g. the application you're using isn't scriptable) then it falls apart.
What I'm getting at is that your requirements are pretty simple to implement in AppleScript because you can get 'under the hood' and do exactly what you want, as opposed to Automator's restricted interface.
The tricky part is that if no one else can see this app it's going to be hard to tell you what to do.
I can give you the basics on reading a file and iterating through the lines of text in it, and I can show you how to 'type' text in any given application, but it may be up to you to put the pieces together.
Here's one way of reading a file and working through each line of text:
-- ask the user for a file:
set theFile to (choose file)
-- read the file contents:
set theFileContents to (read file theFile)
-- break out the lines/paragraphs of text:
set theLines to paragraphs of theFileContents
-- now iterate through those lines, one by one:
repeat with eachLine in theLines
-- code to perform for eachLine goes here
end repeat
Once you have a line of text (eachLine in the above example) you can 'type' that into another application via something like:
tell application "AppName" to activate
tell application "System Events"
tell process "AppName"
keystroke eachLine
end tell
end tell
Here the AppleScript is activating the application and using System Events to emulate typing the contents of the eachLine variable into the process. Put this inside your repeat loop and you're almost there. -
Insert,update and delete data in a table using webdynpro for abap
Dear All,
I have a requirement to create a table allowing the user to add rows in it and update a row as well as delete a row from that table.To do this I guess I have to make use of ALV.But using ALV I am not able to enter data to a table where as I can make a column editable delete a row etc. please guide me to perform these operations(insert,update and delete) on table.
Thanks,
Reddy.Hi Sridhar,
By using ALV you can do all insert delete etc things. if you want to edit i mean you can yenter data in ALV.
Check this...
http://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/3133474a-0801-0010-d692-81827814a5a1
Editing alv in web dynpro
editing rows in alv reports
Re: editing rows and columns in alv reports in webdynpro abap
Cheers,
Kris. -
Want to open an Excel file and load it into Oracle - Oracle COM Automation
I'm doing some test and I got the following errors in the dbms output:
Creating Excel application...
COM-0004: The registered CLSID for the ProgID is invalid.
Invoking Workbooks...
COM-0004: The registered CLSID for the ProgID is invalid.
Invoking Add to WorkBooks...
COM-0002: Invalid Token or no interface for token
I tried to register the orawpcom10.dll on the server but I could not.
I changed the orawpcom10.dll file for a newer one, but I got the same error.
I tried to google the error messages, but I did not find any solution.
Could you give me any idea?
Thanks again,
Javier
Edited by: 882807 on 01-sep-2011 6:01Sorry, I was a little bit busy at work. You can see my answers below:
1. Post your database version from v$version.
SQL> SELECT * FROM v$version;
BANNER
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Prod
PL/SQL Release 10.2.0.1.0 - Production
CORE 10.2.0.1.0 Production
TNS for 32-bit Windows: Version 10.2.0.1.0 - Production
NLSRTL Version 10.2.0.1.0 - Production
SQL>2. The path where orawpcomxx.dll stored (preferably with dir command from command prompt).
C:\oracle\product\10.2.0\db_1\BIN>dir orawpco*.dll
El volumen de la unidad C no tiene etiqueta.
El número de serie del volumen es: E0C2-001B
Directorio de C:\oracle\product\10.2.0\db_1\BIN
22/06/2010 17:40 81.920 orawpcom10.dll
1 archivos 81.920 bytes
0 dirs 31.090.524.160 bytes libres
C:\oracle\product\10.2.0\db_1\BIN>3. Definition (CREATE statement) of UTILS_LIB
create library utils_lib as 'C:\oracle\product\10.2.0\db_1\BIN\orawpcom10.dll';4. Relevant portion of TNSNAMES.ora and LISTNER.ora.
TNSNAMES.ORA
EXTPROC_CONNECTION_DATA =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC0))
(CONNECT_DATA =
(SID = PLSExtProc)
(PRESENTATION = RO)
)LISTENER.ORA
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = vsdwh1.AD.SMS.CARM.ES)(PORT = 1521))
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC0))
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = PLSExtProc)
(ORACLE_HOME = C:\oracle\product\10.2.0\db_1)
(PROGRAM = extproc)
...5. Status (valid/invalid) of ORDExcelSB from all/dba/user_objects.
SQL> select object_name,object_type,status from all_objects where object_name =
'ORDEXCELSB';
OBJECT_NAME OBJECT_TYPE STATUS
ORDEXCELSB PACKAGE VALID
ORDEXCELSB PACKAGE BODY VALID
SQL>6. How you are calling and the actual error (copy paste from SQL prompt).
SQL> SET SERVEROUT ON
SQL> DECLARE
2 v_Name varchar2(90);
3 v_SlNo varchar2(100);
4 v_Job varchar2(200);
5 v_Dept varchar2(100);
6 v_recon_remark varchar2(50);
7 v_sal_amt_usd number;
8 v_Bonus_amt_usd number;
9 result INTEGER;
10
11 i binary_integer;
12 filename varchar2(255);
13 BEGIN
14
15 filename := 'C:\Example.xls';
16
17 result := ORDExcelSB.CreateExcelApplication('');
18 result := ORDExcelSB.OpenExcelFile(filename, 'Sheet1');
19
20 /* Excluding the header row and reading the first 5 row */
21 FOR n in 2 .. 5 LOOP
22
23 v_Name := ORDExcelSB.GetDataStr('A' || n);
24 v_SlNo := ORDExcelSB.GetDataReal('B' || n);
25 v_Job := ORDExcelSB.GetDataStr('C' || n);
26 v_Dept := ORDExcelSB.GetDataStr('D' || n);
27 v_sal_amt_usd := ORDExcelSB.GetDataNum('E' || n);
28 v_Bonus_amt_usd := ORDExcelSB.GetDataNum('F' || n);
29
30 dbms_output.put_line(v_Name || ' ' || v_SlNo || ' ' || v_Job || ' ' ||
31 v_Dept || ' ' || v_sal_amt_usd || ' ' ||
32 v_Bonus_amt_usd);
33
34 END LOOP;
35
36 result := ORDExcelSB.ExitExcel();
37 EXCEPTION
38 WHEN OTHERS THEN
39 result := ORDExcelSB.ExitExcel();
40 RAISE;
41 END;
42 /
Creating Excel application...
COM-0004: The registered CLSID for the ProgID is invalid.
Invoking Workbooks...
COM-0004: The registered CLSID for the ProgID is invalid.
Opening Excel file C:\Example.xls ...
COM-0002: Invalid Token or no interface for token
Opening WorkBook
COM-0002: Invalid Token or no interface for token
Invoking WorkSheets..
COM-0002: Invalid Token or no interface for token
Invoking WorkSheet
COM-0002: Invalid Token or no interface for token
Opened
COM-0002: Invalid Token or no interface for token
COM-0002: Invalid Token or no interface for token
COM-0002: Invalid Token or no interface for token
COM-0002: Invalid Token or no interface for token
COM-0002: Invalid Token or no interface for token
COM-0002: Invalid Token or no interface for token
COM-0002: Invalid Token or no interface for token
COM-0002: Invalid Token or no interface for token
COM-0002: Invalid Token or no interface for token
COM-0002: Invalid Token or no interface for token
COM-0002: Invalid Token or no interface for token
COM-0002: Invalid Token or no interface for token
0 0 0
COM-0002: Invalid Token or no interface for token
COM-0002: Invalid Token or no interface for token
COM-0002: Invalid Token or no interface for token
COM-0002: Invalid Token or no interface for token
COM-0002: Invalid Token or no interface for token
COM-0002: Invalid Token or no interface for token
COM-0002: Invalid Token or no interface for token
COM-0002: Invalid Token or no interface for token
COM-0002: Invalid Token or no interface for token
COM-0002: Invalid Token or no interface for token
COM-0002: Invalid Token or no interface for token
COM-0002: Invalid Token or no interface for token
0 0 0
COM-0002: Invalid Token or no interface for token
COM-0002: Invalid Token or no interface for token
COM-0002: Invalid Token or no interface for token
COM-0002: Invalid Token or no interface for token
COM-0002: Invalid Token or no interface for token
COM-0002: Invalid Token or no interface for token
COM-0002: Invalid Token or no interface for token
COM-0002: Invalid Token or no interface for token
COM-0002: Invalid Token or no interface for token
COM-0002: Invalid Token or no interface for token
COM-0002: Invalid Token or no interface for token
COM-0002: Invalid Token or no interface for token
0 0 0
COM-0002: Invalid Token or no interface for token
COM-0002: Invalid Token or no interface for token
COM-0002: Invalid Token or no interface for token
COM-0002: Invalid Token or no interface for token
COM-0002: Invalid Token or no interface for token
COM-0002: Invalid Token or no interface for token
COM-0002: Invalid Token or no interface for token
COM-0002: Invalid Token or no interface for token
COM-0002: Invalid Token or no interface for token
COM-0002: Invalid Token or no interface for token
COM-0002: Invalid Token or no interface for token
COM-0002: Invalid Token or no interface for token
0 0 0
Closing workbook and quitting...
Closing workbook...
COM-0002: Invalid Token or no interface for token
Closing workbooks...
COM-0002: Invalid Token or no interface for token
COM-0002: Invalid Token or no interface for token
PL/SQL procedure successfully completed.
SQL>Thanks again for your interest.
Javier -
How to write a code for open new txt file in swing
hai all,
now i do one project in java.that project's GUI is Swing. But i don't known swing (basic).So how to write a code for open new txt file and "Open window " in menu item on swing.that means when i click the "New" on menu that time open a new txt file. open also like that type.
plz give me that code ! very urgent
Advance Thanks !
RSKSwing Tutorial:
http://java.sun.com/docs/books/tutorial/uiswing/index.html
Since you don't know the basic of swing read the tutorial, it is for your own good because it is useless if we provide you with a code you don't even understand and how it works.
If you want a menu read the tutorial about using menus and for opening a file read using JFileChooser.
note: don't use the word urgent because it implies that your problem is more important than others. -
How to encypt a .txt file and how to decrypt a same .txt file when i need
My requirement is i want to encrypt a .txt file and
keep it in some folder. In that file we put database connection
information. when ever we need that file we have to access it and decrypt
it. with that decrypted values we have make connection with database.
i am sending a code in which i wrote both encyption and decrytion in same file, but i want to do it separately.
Please help me regarding this.
package com.businessobjects;
import java.io.*;
import java.security.*;
import javax.crypto.*;
public class EncryptDecrypt
public static void EncodeIt()
try
// generate Cipher objects for encoding and decoding
Cipher itsocipher1 = Cipher.getInstance("DES");
Cipher itsocipher2 = Cipher.getInstance("DES");
// generate a KeyGenerator object
KeyGenerator KG = KeyGenerator.getInstance("DES");
System.out.println("Using algorithm " + KG.getAlgorithm());
// generate a DES key
Key mykey = KG.generateKey();
// initialize the Cipher objects
System.out.println("Initializing ciphers...");
itsocipher1.init(Cipher.ENCRYPT_MODE, mykey);
itsocipher2.init(Cipher.DECRYPT_MODE, mykey);
// creating the encrypting cipher stream
//System.out.println("Creating the encrypting cipher stream...");
/*FileInputStream fis = new FileInputStream("Original.txt");
FileOutputStream fos = new FileOutputStream("Encypt.txt");
CipherInputStream cis1 = new CipherInputStream(fis, itsocipher1);
// creating the decrypting cipher stream
//System.out.println("Creating the decrypting cipher stream...");
byte[] b1 = new byte[8];
int i1 = cis1.read(b1);
while (i1 != -1)
fos.write(b1, 0, i1);
i1 = cis1.read(b1);
fis.close();
fos.close();*/
// writing the decrypted data to output file
FileInputStream fis1 = new FileInputStream("Encypt.txt");
FileOutputStream fos1 = new FileOutputStream(Decypt.txt");
CipherInputStream cis2 = new CipherInputStream(fis1, itsocipher2);
byte[] b2 = new byte[8];
int i2 = cis2.read(b2);
while (i2 != -1)
fos1.write(b2, 0, i2);
i2 = cis2.read(b2);
fis1.close();
fos1.close();
//cis1.close();
cis2.close();
catch (Exception e)
System.out.println("Caught exception: " + e);
With regards
Pavankumar.here is the solution you wanted it
uses password based encryption
but your requirements are for very badly
designed code
This is the encryption part
it converts the inputfile original.txt
into the outputfile encrypt.txt which
contains the original encrypted
import java.io.FileInputStream;
import java.io.FileOutputStream;
import javax.crypto.Cipher;
import javax.crypto.spec.PBEKeySpec;
import javax.crypto.spec.PBEParameterSpec;
import javax.crypto.SecretKey;
import javax.crypto.SecretKeyFactory;
public class PWBEncryption {
// Salt
static byte[] salt = {
(byte)0xc7, (byte)0x73, (byte)0x21, (byte)0x8c,
(byte)0x7e, (byte)0xc8, (byte)0xee, (byte)0x99
// Iteration count
static int count = 20;
public PWBEncryption() {
// params:
// password -> the pasword used to create the key
// inputfile -> the file containing the stuff to be encrypted
// i.e. original.txt
// outputfile -> the file that will contain the encrypted stuff
// i.e. encrypt.txt
public static boolean doIt(char[] password,String inputfile,String outputfile){
try{
// Create PBE parameter set
PBEParameterSpec pbeParamSpec = new PBEParameterSpec(salt, count);
PBEKeySpec pbeKeySpec = new PBEKeySpec(password);
// create secretkey
SecretKeyFactory keyFac = SecretKeyFactory.getInstance("PBEWithMD5AndDES");
SecretKey pbeKey = keyFac.generateSecret(pbeKeySpec);
// create cipher
Cipher pbeCipher = Cipher.getInstance("PBEWithMD5AndDES");
pbeCipher.init(Cipher.ENCRYPT_MODE, pbeKey, pbeParamSpec);
// read input
FileInputStream fis = new FileInputStream(inputfile);
byte[] input = new byte[fis.available()];
fis.read(input);
// encrypt
byte[] output = pbeCipher.doFinal(input);
// write encrypted output
FileOutputStream fos = new FileOutputStream(outputfile);
fos.write(output);
return true;
catch(Exception e){
System.out.println(e.toString());
return false;
}This is the decrypt part
import java.io.FileInputStream;
import java.io.FileOutputStream;
import javax.crypto.Cipher;
import javax.crypto.spec.PBEKeySpec;
import javax.crypto.spec.PBEParameterSpec;
import javax.crypto.SecretKey;
import javax.crypto.SecretKeyFactory;
public class PWBDecryption {
// Salt
static byte[] salt = {
(byte)0xc7, (byte)0x73, (byte)0x21, (byte)0x8c,
(byte)0x7e, (byte)0xc8, (byte)0xee, (byte)0x99
// Iteration count
static int count = 20;
public PWBDecryption() {
// params:
// password -> the pasword used to create the key
// inputfile -> the file containing the decrypted data
// i.e. encrypt.txt
// outputfile -> the file that will contain the decrypted data
// i.e. decrypt.txt
public static boolean doIt(char[] password,String inputfile,String outputfile){
try{
// Create PBE parameter set
PBEParameterSpec pbeParamSpec = new PBEParameterSpec(salt, count);
PBEKeySpec pbeKeySpec = new PBEKeySpec(password);
// create secretkey
SecretKeyFactory keyFac = SecretKeyFactory.getInstance("PBEWithMD5AndDES");
SecretKey pbeKey = keyFac.generateSecret(pbeKeySpec);
// create cipher
Cipher pbeCipher = Cipher.getInstance("PBEWithMD5AndDES");
pbeCipher.init(Cipher.DECRYPT_MODE, pbeKey, pbeParamSpec);
// read input
FileInputStream fis = new FileInputStream(inputfile);
byte[] input = new byte[fis.available()];
fis.read(input);
// encrypt
byte[] output = pbeCipher.doFinal(input);
// write encrypted output
FileOutputStream fos = new FileOutputStream(outputfile);
fos.write(output);
return true;
catch(Exception e){
return false;
}runner
public class RunRun {
public RunRun() {
public static void main(String args[]){
char password[] = {'q','w','e','r','t','y'};
boolean enc = PWBEncryption.doIt(password,"C:\\original.txt","c:\\encrypt.txt");
System.out.println("Encryption status == "+enc);
boolean dec = PWBDecryption.doIt(password,"c:\\encrypt.txt","c:\\decrypt.txt");
System.out.println("Decryption status == "+dec);
} -
How to header and item data of sales order using bapi interface
hi friends,
i am geetha, i having a problem like how to upload sales oder header and item data through va01 tcode using BAPI FUNCTION MODULES.
i need bapi function modules for header adn item data and brief explation on that , how to pass importing and tables parameters to get exact output .
regards
geetha.Use : BAPI_SALESORDER_CREATEFROMDAT2
Sales order: Create Sales Order
Functionality
You can use this method to create sales orders.
You must enter at least sales order header data (via ORDER_HEADER_IN structure) and partner data (via the ORDER_PARTNERS table) as input parameters.
Enter the item data via the ORDER_ITEMS_IN table. You can allocate item numbers manually, by filling in the relevant fields, or the system does it, according to the settings for Customizing, by leaving the relevant fields blank.
If you have configurable items, you must enter the configuration data in the ORDER_CFGS_REF, ORDER_CFGS_INST, ORDER_CFGS_PART_OF and ORDER_CFGS_VALUE tables.
Credit cards can be transferred via the BAPICCARD structure, on the one hand, data for card identification, on the other, data for a transaction which has taken place in an external system.
Once you have created the sales order successfully, you will receive the document number (SALESDOCUMENT field). Any errors that may occur will be announced via the RETURN parameter.
If no sales area has been created in the sales order header, then the system creates the sales area from the sold-to party or ship-to party, who has been entered in the partner table. If a clear sales area cannot be created, you will receive a system message, and the sales order will not be created.
Notes
1. Mandatory entries:
ORDER_HEADER_IN : DOC_TYPE Sales document type
SALES_ORG Sales organization
DISTR_CHAN Distribution channel
DIVISION Division
ORDER_PARTNERS..: PARTN_ROLE Partner role, SP sold-to party
PARTN_NUMB Customer number
ORDER_ITEMS_IN..: MATERIAL Material number
2. Ship-to party:
If no ship-to party is entered, use the following: Ship-to party =
sold-to party.
3. Commit control:
The BAPI does not have a database commit. This means that the relevant application must leave the commit, in order that can be carried out on on the database. The BAPI BAPI_TRANSACTION_COMMIT is available for this.
4. German key words:
The following key words must be entered in German, independantly of
the logon language:
DOC_TYPE Sales document type, for example: TA for standard order
PARTN_ROLE Partner role, for example: WE for ship-to party
Further information
You can find further information in the OSS. The note 93091 contains general information on the BAPIs in SD.
Parameters
SALESDOCUMENTIN
ORDER_HEADER_IN
ORDER_HEADER_INX
SENDER
BINARY_RELATIONSHIPTYPE
INT_NUMBER_ASSIGNMENT
BEHAVE_WHEN_ERROR
LOGIC_SWITCH
TESTRUN
CONVERT
SALESDOCUMENT
RETURN
ORDER_ITEMS_IN
ORDER_ITEMS_INX
ORDER_PARTNERS
ORDER_SCHEDULES_IN
ORDER_SCHEDULES_INX
ORDER_CONDITIONS_IN
ORDER_CONDITIONS_INX
ORDER_CFGS_REF
ORDER_CFGS_INST
ORDER_CFGS_PART_OF
ORDER_CFGS_VALUE
ORDER_CFGS_BLOB
ORDER_CFGS_VK
ORDER_CFGS_REFINST
ORDER_CCARD
ORDER_TEXT
ORDER_KEYS
EXTENSIONIN
PARTNERADDRESSES
Exceptions
Function Group
2032
Maybe you are looking for
-
Attempt to burn a disc failed. An unknown error occurred (4280).
I put a blank CD in. I open iTunes. I click on a play list and attempt to burn. It checks the play list like everything is fine and seems like it begins to burn the first track. Then after a few seconds it says *_canceling disc_*. It ejects the CD an
-
Disabling iOS 7 Activation Lock in an enterprise environment.
I'm wondering if anyone has found a solution for disabling the new Activation Lock feature in iOS 7 without needing to supervise the device through Apple Configurator? My dilemma is we have about 50 iPhones deployed in our company. The only way I h
-
Sun Java(tm) System Messaging Server 6.3-6.03 (built Mar 14 2008; 32bit) libimta.so 6.3-6.03 (built 17:07:13, Mar 14 2008; 32bit) SunOS hermes 5.10 Generic_137112-05 i86pc i386 i86pc I'm having a huge problem. Messages from the internet that reverse
-
[Evolution Mail and Gnome Keyring] keeps asking passwords
Hi, I can't use my mail boxes in Evolution since more than one week. Here is what "$ LANG=C env CAMEL_DEBUG=all evolution" says: http://pastebin.archlinux.fr/500794 (passwords and personal mail addresses and information removed). I am prompted for th
-
SCCM Windows 7 Collection Query 32 bit
I'm trying to get 32-bit Windows 7 collection on SCCM 2007. Here is my query: select SMS_R_SYSTEM.ResourceID,SMS_R_SYSTEM.ResourceType,SMS_R_SYSTEM.Name,SMS_R_SYSTEM.SMSUniqueIdentifier,SMS_R_SYSTEM.ResourceDomainORWorkgroup,SMS_R_SYSTEM.Client from