private void preProcessQueryHelper(String fileName,
			HashSet<String> stopwordsSet, String outFile, int queryCol,
			HashSet<String> prodWords) {
		try {
			FileReader qFileReader = new FileReader(fileName);
			BufferedReader qBuffReader = new BufferedReader(qFileReader);
			FileWriter fWriter = new FileWriter(outFile);
			PrintWriter pWriter = new PrintWriter(fWriter);
			String line = null;
			while ((line = qBuffReader.readLine()) != null) {
				// Split the query into words and store into string array
				String[] columns = line.split(",");

				// Query is present at the index 3 of the string array
				String temp = columns[queryCol].trim();
				// System.out.println(temp);

				// Calling helper function for removing special characters
				temp = removeSpecialCharacters(temp);

				// Converting the query into lower case
				temp = temp.toLowerCase();

				// Helper function for removing the stop-words and sorting all
				// words
				temp = removeStopWordsAndSort(temp, stopwordsSet);
				
				// Helper function for correcting the query words as per the
				// product XML file provided
				temp = wc.matchQueryWordToProduct(temp, prodWords);

				// System.out.println(temp);

				for (int i = 0; i < columns.length; i++) {
					if (i == queryCol) {
						pWriter.print("\""+ temp + "\"" + ",");
					} else if(i == columns.length-1) {
						pWriter.print(columns[i]);
					}
					else {
						pWriter.print(columns[i] + ",");
					}
				}
				pWriter.println();
			}
			pWriter.close();
			fWriter.close();
			qBuffReader.close();
			qFileReader.close();
		} catch (Exception exp) {
			exp.printStackTrace();
			System.exit(1);
		}
	}