[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

batch file question

Posted on 2004-10-05
16
Medium Priority
?
224 Views
Last Modified: 2010-03-31
hi!

I have this batch file, and can someone tell what does these lines do?

@echo off
java extractHeader g:\temp mri for header ext

thanks,
0
Comment
Question by:dkim18
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 7
  • 5
  • 4
16 Comments
 
LVL 86

Assisted Solution

by:CEHJ
CEHJ earned 80 total points
ID: 12231704
1. don't echo output
2. run java class 'extractHeader' passing remainder of line as parameters to the java program
0
 

Author Comment

by:dkim18
ID: 12231804

what does "g:\temp"  do on second line?

0
 
LVL 86

Expert Comment

by:CEHJ
ID: 12231908
Possibly just a directory parameter to the java program
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 92

Expert Comment

by:objects
ID: 12232326
> what does "g:\temp"  do on second line?

it is passed as an argument to the java application.
the application will use that value (accessible from args passed to main)
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 12232343
>>it is passed as an argument to the java application ...

Already mentioned
0
 
LVL 92

Expert Comment

by:objects
ID: 12232385
I'm providinding clarification and more information to help dkim18, why do you have a problem with that?

0
 

Author Comment

by:dkim18
ID: 12233307
Let's not fight too much over points...

I understand it is passed as arguement. I was was wondering there were any relationships among "g:\temp", 'mri', 'for' ,  'header',  'ext', since there were spaces among those. However, I didn't any particular code that treat them as second, or thrid arguement.

Sorry if my question wasn't clear. I thought "g:\temp", does anything special to other args.
0
 
LVL 92

Expert Comment

by:objects
ID: 12233340
> Let's not fight too much over points...

funnily enuf the points don't bother me :)

not sure why cehj has a problem with me trying to help.

> I was was wondering there were any relationships among "g:\temp", 'mri', 'for' ,  'header',  'ext', since there were spaces among those.

they are just seperate args, it depends on how the app deals with them:

args[0]="g:\temp"
args[1]="mri"
args[2]="for"
args[3]="header"
args[4]="ext"
0
 

Author Comment

by:dkim18
ID: 12233437
Now, I found the following code in the main. (I am reading someone else's code that was written a few years ago  and there are a few same files..)

      public static void main(String[] args) throws Exception
      {

      while (true){
            String mappedDrive;

            try
            {      
                  if (args[0] != null)
                        mappedDrive = args[0];
                  else
                        mappedDrive = "E";
            }
            catch (Exception e)
            {
                  mappedDrive = "E";
            }

            UIManager.setLookAndFeel(new MetalLookAndFeel());
            JFileChooser chooser = new JFileChooser();

            if (runOnce == false)
                  startDir = mappedDrive + ":" + System.getProperty("file.separator") + "scans\\Scans_for_header_ext";

            File directory = new File(startDir);

            chooser.setCurrentDirectory(directory);
            chooser.setFileSelectionMode(JFileChooser.FILES_AND_DIRECTORIES);
            int returnVal = chooser.showOpenDialog(null);
            if (returnVal == JFileChooser.APPROVE_OPTION)
            {
                  if (runOnce == false)
                        startDir = getStartPath(chooser.getSelectedFile().getAbsolutePath());
            
                  String fileOutPath = System.getProperty("user.home") + System.getProperty("file.separator") +
                        "Desktop" + System.getProperty("file.separator") + "001.hdr";

                  File outf = new File(getOutPath(chooser.getSelectedFile().getAbsolutePath()));

                  PrintWriter out = new PrintWriter(new FileWriter(outf));
System.out.println(outf);
System.out.println(chooser.getSelectedFile());
                  DicomFile dicom = new DicomFile(chooser.getSelectedFile());

                  Vector ElementNameVector = dicom.getElementNameVector(); // names of catagories
                  Vector ElementValueVector = dicom.getElementValueVector(); // bunch of large numbers
                  Vector ElementDataStringVector = dicom.getElementDataStringVector(); // data

                  Object[] catagories = ElementNameVector.toArray();
                  Object[] data = ElementDataStringVector.toArray();

                  String finalHeader = "(";
            
                  for (int i = 0; i < ElementNameVector.size(); i++)
                  {
                        finalHeader = finalHeader + "(" + catagories[i].toString() + " " + data[i].toString() + ") ";
                  }
            
                  out.print(finalHeader);
                  out.print(")");
                  out.close();
            
            }
            else
                  System.exit(0);

            if (runOnce == false)
                  runOnce = true;
      }
      }
++++++++++++
what does "scans\\Scans_for_header_ext" do for the following line?

startDir = mappedDrive + ":" + System.getProperty("file.separator") + "scans\\Scans_for_header_ext";

(\\ indicates double back slash)

thanks,
-I increased points since I am asking different question


0
 
LVL 92

Accepted Solution

by:
objects earned 520 total points
ID: 12233462
it creating a string containing a file path to the directory Scans_for_header_ext.
0
 

Author Comment

by:dkim18
ID: 12233696
does "scans\" do anything special?
0
 
LVL 92

Expert Comment

by:objects
ID: 12233970
no, thats just a directory name.

eg. if mappedDrive was "E" then startDir would be:

E:\scans\Scans_for_header_ext
0
 
LVL 92

Assisted Solution

by:objects
objects earned 520 total points
ID: 12233976
> startDir = mappedDrive + ":" + System.getProperty("file.separator") + "scans\\Scans_for_header_ext";

you'd get the same effect with:

startDir = mappedDrive + ":/scans/Scans_for_header_ext";
0
 

Author Comment

by:dkim18
ID: 12234023
thank you so much!
0
 
LVL 92

Expert Comment

by:objects
ID: 12234124
no worries bud :)
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 12235631
8-)
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

For beginner Java programmers or at least those new to the Eclipse IDE, the following tutorial will show some (four) ways in which you can import your Java projects to your Eclipse workbench. Introduction While learning Java can be done with…
By the end of 1980s, object oriented programming using languages like C++, Simula69 and ObjectPascal gained momentum. It looked like programmers finally found the perfect language. C++ successfully combined the object oriented principles of Simula w…
Viewers learn how to read error messages and identify possible mistakes that could cause hours of frustration. Coding is as much about debugging your code as it is about writing it. Define Error Message: Line Numbers: Type of Error: Break Down…
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
Suggested Courses

650 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question