Discussion:
from cmd to Java
(too old to reply)
k***@gmail.com
2013-04-05 00:42:41 UTC
Permalink
how to code this in java not script but compiling
this is in cmd


set home=%~dp0
set file_to_find=A_job-2-do_
set when_done=B_Job-done

for /f "delims=" %%A in ('dir /s/b/o:n/d:-a ^"%home%%file_to_find%^"') do (
for /f "delims=" %%z in ('call rename.cmd ^"%%~A^" ^"\%file_to_find%^" "\%when_done%"') do (
for /f "tokon=1,2 delims=" %%B in (%%~A) do (
"7za.exe" a -t7z -m0=LZMA -mmt=on -mx9 -md=128m -mfb=273 -ms=e -sccUTF-8 -w"%%~dpA" "%%~B" "%%~A"
)
rename "%%~A" "%%~nx.z"
)
echo done
pause
Joerg Meier
2013-04-05 00:47:54 UTC
Permalink
Post by k***@gmail.com
how to code this in java not script but compiling
this is in cmd
set home=%~dp0
set file_to_find=A_job-2-do_
set when_done=B_Job-done
for /f "delims=" %%A in ('dir /s/b/o:n/d:-a ^"%home%%file_to_find%^"') do (
for /f "delims=" %%z in ('call rename.cmd ^"%%~A^" ^"\%file_to_find%^" "\%when_done%"') do (
for /f "tokon=1,2 delims=" %%B in (%%~A) do (
"7za.exe" a -t7z -m0=LZMA -mmt=on -mx9 -md=128m -mfb=273 -ms=e -sccUTF-8 -w"%%~dpA" "%%~B" "%%~A"
)
rename "%%~A" "%%~nx.z"
)
echo done
pause
Start by going to www.google.com and type in "Java tutorial", then follow
the steps in the links. Or pay someone to do your work for you.

Liebe Gruesse,
Joerg
--
Ich lese meine Emails nicht, replies to Email bleiben also leider
ungelesen.
J Lee Hughes
2013-04-05 02:47:21 UTC
Permalink
Post by Joerg Meier
Post by k***@gmail.com
how to code this in java not script but compiling
this is in cmd
set home=%~dp0
set file_to_find=A_job-2-do_
set when_done=B_Job-done
for /f "delims=" %%A in ('dir /s/b/o:n/d:-a ^"%home%%file_to_find%^"') do (
for /f "delims=" %%z in ('call rename.cmd ^"%%~A^" ^"\%file_to_find%^" "\%when_done%"') do (
for /f "tokon=1,2 delims=" %%B in (%%~A) do (
"7za.exe" a -t7z -m0=LZMA -mmt=on -mx9 -md=128m -mfb=273 -ms=e -sccUTF-8 -w"%%~dpA" "%%~B" "%%~A"
)
rename "%%~A" "%%~nx.z"
)
echo done
pause
Start by going to www.google.com and type in "Java tutorial", then follow
the steps in the links. Or pay someone to do your work for you.
Liebe Gruesse,
Joerg
--
Ich lese meine Emails nicht, replies to Email bleiben also leider
ungelesen.
I did go to java tutal and did not get the answer
I do my own work

I can code in GO C C# Basic
I trying to get in to Java so it may be cross platfor
I use linux unix windows and mac x

C and basic is to match work to get the app for all

if I can you GO or GOS would be the best but most API will not work with it yet
Lew
2013-04-05 01:13:56 UTC
Permalink
how to code this in java [sic] not script but compiling
this is in cmd
set home=%~dp0
This would likely be a variable assignment in Java.
set file_to_find=A_job-2-do_
You would use a 'String' to hold the filename, then build probably a 'java.io.File'
over that.
set when_done=B_Job-done
Looks like a boolean condition in a 'while' or 'for' type of construct in Java.
for /f "delims=" %%A in ('dir /s/b/o:n/d:-a ^"%home%%file_to_find%^"') do (
Java 'for' loop.
for /f "delims=" %%z in ('call rename.cmd ^"%%~A^" ^"\%file_to_find%^" "\%when_done%"') do (
You would have to code up the rename. There's a method in 'java.io.File' that could help.
for /f "tokon=1,2 delims=" %%B in (%%~A) do (
Whatever this is supposed to do, you can do with a 'for' loop and parsing or splitting out
stuff from a 'String'.
"7za.exe" a -t7z -m0=LZMA -mmt=on -mx9 -md=128m -mfb=273 -ms=e -sccUTF-8 -w"%%~dpA" "%%~B" "%%~A"
If you already have an executable, would you recode it in Java or use it directly?
)
rename "%%~A" "%%~nx.z"
)
echo done
'System.out.println("done");'
pause
Various 'sleep()' methods.
--
Lew
J Lee Hughes
2013-04-05 02:31:14 UTC
Permalink
how to code this in java not script but compiling
this is in cmd

::set var
set home=%~dp0
set file_to_find=A_job-2-do_
set when_done=B_Job-done

::the dir will go to the filesystem and get from were app is file is sup dirtory that meet A_job-2-do_*.txt
:: the A_job-2-do_*.txt con contank a "input file address","output file address"
:: the for will run tell the end of file
for /f "delims=" %%A in ('dir /s/b/o:n/d:-a ^"%home%%file_to_find%^"') do (
:: this for look call a script that will replace the file address from what in var file_to_find to var When_done :like substition
for /f "delims=" %%z in ('call rename.cmd ^"%%~A^" ^"\%file_to_find%^" "\%when_done%"') do (
::this for loop that the line and put input in input %%B and output %%C for output
for /f "tokon=1,2 delims=" %%B in (%%~A) do (
::this call the 7z app and conpress the input file to output file command line
"7za.exe" a -t7z -m0=LZMA -mmt=on -mx9 -md=128m -mfb=273 -ms=e -sccUTF-8 -w"%%~dpA" "%%~B" "%%~A"
)
:: this rename when done with file to done
rename "%%~A" "%%~nx.z"
)
:tell when done lets you know
echo done
pause


sorry I did not comment this
J Lee Hughes
2013-04-05 02:42:13 UTC
Permalink
I have that for filesystem I have to do

var BaseOfWork as new filesystem;

var FaInput as new filesytem;
var FaOutput as new filesytem;

var FileTypeA as string="A_job-2-do_";
var FileTypeB as string="B_Job-done_";

can not file how to get the base of app
can not file how to ask the filesystem for the location of file after the base of app time that match in the var FIleTypeA

I think a math.subtitution will work
but how to rename the file it all was done all ok
Lew
2013-04-05 05:30:01 UTC
Permalink
Post by J Lee Hughes
I have that for filesystem I have to do
var BaseOfWork as new filesystem;
var FaInput as new filesytem;
var FaOutput as new filesytem;
var FileTypeA as string="A_job-2-do_";
var FileTypeB as string="B_Job-done_";
can not file how to get the base of app
can not file how to ask the filesystem for the location of file after the base of app time that match in the var FIleTypeA
I think a math.subtitution will work
but how to rename the file it all was done all ok
None of that is Java. It looks like Javascript.
--
Lew
J Lee Hughes
2013-04-05 10:39:44 UTC
Permalink
Post by Lew
Lew
None of that is Java. It looks like Javascript.
so is there form of java script that you compile!
1connu
2013-04-05 11:16:27 UTC
Permalink
Post by J Lee Hughes
Post by Lew
Lew
None of that is Java. It looks like Javascript.
so is there form of java script that you compile!
There is some java (GWT from google) that compile into javascript !
J Lee Hughes
2013-04-05 11:27:25 UTC
Permalink
IM going to compile a portable app or a java top application!

to what I know java script the ones like CMD do not work allwas
p***@gmail.com
2013-04-05 11:27:39 UTC
Permalink
Post by J Lee Hughes
Post by Lew
Lew
None of that is Java. It looks like Javascript.
so is there form of java script that you compile!
I'm not sure if I am interpreting your request correctly.

JavaScript and Java are totally different things (in spite of having similar names). If you are after something to do with JavaScript (maybe a JavaScript compiler?) then I think you are asking the wrong group.

If you are asking about Java then I'm not sure quite what you are after.
J Lee Hughes
2013-04-05 13:55:57 UTC
Permalink
Post by p***@gmail.com
Post by J Lee Hughes
Post by Lew
Lew
None of that is Java. It looks like Javascript.
so is there form of java script that you compile!
I'm not sure if I am interpreting your request correctly.
JavaScript and Java are totally different things (in spite of having similar names). If you are after something to do with JavaScript (maybe a JavaScript compiler?) then I think you are asking the wrong group.
If you are asking about Java then I'm not sure quite what you are after.
I think I what java and not javascript I need to interface with filesystem and pass file to other applications.
Lew
2013-04-05 20:35:13 UTC
Permalink
I think I what [sic] java [sic] and not javascript [sic] I need to interface with filesystem and
pass file to other applications.
Then you need to follow Joerg Meier's advice upthread.

Most of what you want should be in basic Java plus the java.io package.
--
Lew
Roedy Green
2013-04-05 05:44:39 UTC
Permalink
Post by k***@gmail.com
how to code this in java not script but compiling
this is in cmd
I have composed a small library for doing this sort of thing.
see http://mindprod.com/products1.html#BATIK

The nice thing about it is you find out about mistakes at compile
time.
--
Roedy Green Canadian Mind Products http://mindprod.com
Motors make noise, and that tells you about the feelings and attitudes
that went into it. Something was more important than sensory pleasure --
nobody would invent a chair or dish that smelled bad or that made horrible
noises -- why were motors invented noisy? How could they possibly be
considered complete or successful inventions with this glaring defect?
Unless, of course, the aggressive, hostile, assaultive sound actually served
to express some impulse of the owner.
~ Philip Slater (born: 1927 age: 85)
The Wayward Gate: Science and the Supernatural
Loading...