Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to store link in java
    primarykey
    data
    text
    <p>I am trying to generate a csv file. In this when I add the image then it'll store on server and then that image's path/link. I am trying to parse it and write into csv file. This links length is very big. So in csv its put that path on line and again put new. How to solve this?</p> <p>Java Code:</p> <pre><code> File fXmlFile = new File("d:/Eff_SOR/formdata.xml"); DocumentBuilderFactory dbFactory = DocumentBuilderFactory.newInstance(); DocumentBuilder dBuilder = dbFactory.newDocumentBuilder(); Document doc = dBuilder.parse(fXmlFile); doc.getDocumentElement().normalize(); System.out.println("Root element :" + doc.getDocumentElement().getNodeName()); NodeList nList = doc.getElementsByTagName("record"); System.out.println("----------------------------"); List&lt; Map&lt;String, String&gt;&gt; list = new ArrayList&lt;Map&lt;String,String&gt;&gt;(); for (int temp = 0; temp &lt; nList.getLength(); temp++) { Map&lt;String, String&gt; map = new HashMap&lt;String, String&gt;(); Node nNode = nList.item(temp); if (nNode.getNodeType() == Node.ELEMENT_NODE) { Element eElement = (Element) nNode; map.put("Original_Price_signature", eElement.getElementsByTagName("original_price_signature").item(0).getTextContent()); list.add(map); } } generateCsvFile("d:\\SOR\\SOR.csv", list ); ....................... ............................ private static void generateCsvFile(String sFilename, List&lt; Map&lt;String, String&gt;&gt; test) { try { FileWriter writer = new FileWriter(sFilename); for (Map&lt;String, String&gt; map : test) { Iterator iterator = map.entrySet().iterator(); while (iterator.hasNext()) { Map.Entry&lt;String,String&gt; mapEntry = (Map.Entry&lt;String,String&gt;) iterator.next(); //ystem.out.println("key: " + mapEntry.getKey() + ", value:" + mapEntry.getValue()); writer.append(mapEntry.getValue()); writer.append(","); iterator.remove(); } writer.append(LINE_BREAK); } writer.flush(); writer.close(); }catch(Exception e){ } } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload