| | |
File I/O Manipulation Prob
Please support our Java advertiser: Programming Forums - DaniWeb Sister Site
![]() |
•
•
Join Date: Jul 2004
Posts: 6
Reputation:
Solved Threads: 0
Hey,
First off I'm really new to Java so please bear with me. I need to read in a file and translate it to a different output format. An example line segment from the input file has the following format:
"step(procs(),rule(1,A,B,vars(Na,Rv,ped(pk(B),cat(Na,A)))),procs())" (i)
This means that at step 1, A sends to B that which is contained in vars() i.e. Na, Rv and encryption of Na and A using B's public key [ped(pk(B),cat(Na,A))]
The output format I need is the following:
"K_B,t1(R(B,t1,(Na,Rv,e({Na,A},pk_B))))" (ii)
Basically this is generated from what is enclosed within rule() from (i) above. I have read up on how to use files and manipulate them and from what I've read I think i need to use string tokenisers to separate out the input format and thus build up the output form. However I really am at a loss as to how to begin coding this translation. If anyone has the time could they perhaps give me an example of some code that might solve this problem i.e. read in the file, translate the input to the form needed and then output the translated text to an output file. This is only a very small part of the overall translation that must be undertaken but seeing as I am so new to programming, if I could see how to get started the rest of the problem might not seem so daunting.
Thanks a million.
First off I'm really new to Java so please bear with me. I need to read in a file and translate it to a different output format. An example line segment from the input file has the following format:
"step(procs(),rule(1,A,B,vars(Na,Rv,ped(pk(B),cat(Na,A)))),procs())" (i)
This means that at step 1, A sends to B that which is contained in vars() i.e. Na, Rv and encryption of Na and A using B's public key [ped(pk(B),cat(Na,A))]
The output format I need is the following:
"K_B,t1(R(B,t1,(Na,Rv,e({Na,A},pk_B))))" (ii)
Basically this is generated from what is enclosed within rule() from (i) above. I have read up on how to use files and manipulate them and from what I've read I think i need to use string tokenisers to separate out the input format and thus build up the output form. However I really am at a loss as to how to begin coding this translation. If anyone has the time could they perhaps give me an example of some code that might solve this problem i.e. read in the file, translate the input to the form needed and then output the translated text to an output file. This is only a very small part of the overall translation that must be undertaken but seeing as I am so new to programming, if I could see how to get started the rest of the problem might not seem so daunting.
Thanks a million.
![]() |
Similar Threads
- VB 6.0 file manipulation prob... (Visual Basic 4 / 5 / 6)
Other Threads in the Java Forum
- Previous Thread: Switch Case Statement
- Next Thread: SIMPLE BOX GIVING ME PROBLEMS--this is homeowrk but i have tried for hours
| Thread Tools | Search this Thread |
Tag cloud for Java
android api apple applet application arc arguments array arrays automation binary bluetooth c++ chat class classes client code codesnippet component csv database doctype draw ebook eclipse error event exception fractal freeze game givemetehcodez graphics gui html ide image input integer intellij iphone j2me java java.xls javaprojects jmf jni jpanel julia linux list loop loops mac map method methods mobile netbeans newbie number online oracle page parameter plazmic print problem program programming project recursion reporting rotatetext scanner screen sell server set size sms socket sort sourcelabs sql string superclass swing system template test testautomation threads time title tree tutorial-sample windows working





