Note that there are some explanatory texts on larger screens.

plurals
  1. POwriting text which reading and writing only one column
    primarykey
    data
    text
    <p>My text this</p> <pre><code>sirket;sehir;ilce;unvan;numara AKSA SAT VE PAAMA ANM RKET KADY BES;STANBUL;KADIKY;A.S.;1230488; KER BV SANAY;STANBUL;ZEYTNBURNU;A:S.;308133; C.E.S.COSKUN MH.N.ELK.DAY.TK.MAL.VE GIDA TC.LTD.T.;HATAY;SKENDERUN;LTD. T.;14947; ANLU GAZ TCARET VE SANY ANNM RKET KIRIKKALE UBES;KIRIKKALE;KIRIKKALE;A.S.;12519; BVR GIDA MARİ NAAT TURZM SANAY VE TCARET LTD.T.;STANBUL;LO;LTD:STİ.;239; ASA AKRLK KMYA SANAY (YALOVA UBES);YALOVA;FTLKKY;A.S.;551484; WNCOR NXDORF LGSAYR SSTEER A.S.-ESNLER SUES;STANBUL;ESENLER;-;1027; DESA DER SAN. VE TC.;STANBUL;BAKIRKY;A.S.;1480; SNTM BLŞM TEKJLER SAN. VE TC;DYARBAKIR;YENEHR;A.S.;1439; </code></pre> <p>ı want change "." character instead of ":" at <strong>only unvan column</strong> which contain A.S. ,LTD.T.,LTD:STİ. etc.When java read text ı delete first line.I give first line for understable.And ı want to write <strong>before changing</strong>, <strong>after changing</strong> But my code has problem it can not write text due to ı think space of at sirket column. How can ı write it.</p> <p>ı want this output</p> <pre><code>KER BV SANAY;STANBUL;ZEYTNBURNU;A:S.;3083; KER BV SANAY;STANBUL;ZEYTNBURNU;A.S.;308133; BULVAR GIDA MAMLLERİ NAAT TURZM SANAY VE TCARET LTD.T.;STANBUL;LO;LTD:STİ.;2149; BULVAR GIDA MAMLLERİ NAAT TURZM SANAY VE TCARET LTD.T.;STANBUL;LO;LTD.STİ.;239; </code></pre> <p>my code is</p> <pre><code>public class MaliyeBir { private static String inputPath = "C:\\deneme\\Maliye.csv"; private static String outputPath = "C:\\yazdirilan\\YazdirilanMaliye.csv"; private static BufferedReader bufferedReader; private static PrintWriter printWriter; public static void main(String[] args) { try { FileInputStream inputStream = new FileInputStream(inputPath); Reader reader = new InputStreamReader(inputStream, "ISO-8859-9"); bufferedReader = new BufferedReader(reader); FileOutputStream outputStream = new FileOutputStream(outputPath); Writer writer = new OutputStreamWriter(outputStream, "ISO-8859-9"); printWriter = new PrintWriter(writer); String line; while ((line = bufferedReader.readLine()) != null) { EndeksDegeri eD; eD = lineToClass(line); if (shouldOutput(eD)) { printWriter.append(classToLine(eD, true)); printWriter.append(classToLine(eD, false)); } } } catch (IOException e) { e.printStackTrace(); } finally { try { bufferedReader.close(); printWriter.close(); } catch (IOException e) { e.printStackTrace(); } } } private static boolean shouldOutput(EndeksDegeri eD) { if (!eD.tip.contains(":")) { return false; } return true; } private static String classToLine(EndeksDegeri eD, boolean original) { if (!original) { eD.tip = eD.tip.replace(":", "."); } return eD.sirket.concat(";") .concat(eD.sehir).concat(";") .concat(eD.ilce).concat(";") .concat(eD.tip).concat(";") .concat(String.valueOf(eD.numara) .concat("\r\n")); } private static EndeksDegeri lineToClass(String line) { String[] element = line.split(";"); EndeksDegeri endeksDegeri = new EndeksDegeri(); endeksDegeri.sirket = element[0]; endeksDegeri.sehir = element[1]; endeksDegeri.ilce = element[2]; endeksDegeri.tip = element[3]; endeksDegeri.numara = Integer.valueOf(element[4]); return endeksDegeri; } </code></pre>
    singulars
    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.
    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