I created a batch file like given below , but this is not getting hidden in command prompt evev though echo off is used.
I doesn't want csv file or any other file to display in command prompt. it is also showing warning using password in command prompt is insecure, please help me.
this batch file when run in command prompt produces W P.xls as output file
@echo off
echo %1
echo SET @bdate := "%1"; > a.sql
copy /b a.sql + bdate.sql out.sql
mysql --user="root" --database="abc" --password="123" < "D:\New Folder\out.sql"
java -jar csvtoxls.jar
del out.sql
del ws.csv
rename "W P.xls" "W P"%1".xls"
jar file import java.io.DataInputStream; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.IOException; import java.util.ArrayList;
import org.apache.poi.hssf.usermodel.HSSFCell;
import org.apache.poi.hssf.usermodel.HSSFRow;
import org.apache.poi.hssf.usermodel.HSSFSheet;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
public class csv2 {
@SuppressWarnings("deprecation")
public static void main(String args[]) throws IOException {
ArrayList<ArrayList<String>> allRowAndColData = null;
ArrayList<String> oneRowData = null;
String fName = "C:\\New folder\\ws.csv";
String currentLine;
FileInputStream fis = new FileInputStream(fName);
DataInputStream myInput = new DataInputStream(fis);
int i = 0;
allRowAndColData = new ArrayList<ArrayList<String>>();
while ((currentLine=myInput.readLine()) != null) {
oneRowData = new ArrayList<String>();
String oneRowArray[] = currentLine.split(";");
for (int j = 0; j < oneRowArray.length; j++) {
oneRowData.add(oneRowArray[j]);
}
allRowAndColData.add(oneRowData);
System.out.println();
i++;
}
try {
HSSFWorkbook workBook = new HSSFWorkbook();
HSSFSheet sheet = workBook.createSheet("sheet1");
for (int i1 = 0; i1 < allRowAndColData.size(); i1++) {
ArrayList<?> ardata = (ArrayList<?>) allRowAndColData.get(i1);
HSSFRow row = sheet.createRow((short) 0 + i1);
for (int k = 0; k < ardata.size(); k++) {
System.out.print(ardata.get(k));
HSSFCell cell = row.createCell((short) k);
cell.setCellValue(ardata.get(k).toString());
}
System.out.println();
}
FileOutputStream fileOutputStream = new FileOutputStream("C:\\New folder\\W P.xls");
workBook.write(fileOutputStream);
fileOutputStream.close();
} catch (Exception ex) {
}
}
}