i got the list of applications from cmd command using /output:D:\\list.txt product get name,version. However when i try to retrieve the list using java the output has white spac
Looks like you read a UTF-16 encoded file.
Give a hint to your Reader - pass "UTF-16", instead of "ISO-8859-1".
This can be due to the encoding problem. Try using UTF-16
character set
BufferedReader reader = new BufferedReader(new InputStreamReader(new FileInputStream(path), "UTF-16"));
FileReader fileReader;
try {
fileReader = new FileReader( "D:\\list.txt" );
BufferedReader bufferedReader = new BufferedReader( fileReader );
String line;
while( ( line = bufferedReader.readLine() ) != null )
{
System.out.println( line );
}
fileReader.close();
} catch ( IOException except ) {
System.err.println( except.getStackTrace()[0] );
}
Im not shure where your problem is coming from, but you may take the FileReader for such instructions.