How get output generated as csv file  by reading  by buffered reader and wr

how get output generated as csv file by reading by buffered reader and writer

String file_location = "C\temp\csv.txt");
try {
     URL fileURL = getClass().getResource(file_location);
     if (fileURL != null){
          BufferedReader br = new BufferedReader(new InputStreamReader(fileURL.openStream()));
          String s = br.readLine();
          while (s != null)  {
               if (!s.equals ("")) {
                    System.out.println(s);
               s = br.readLine();
          br.close();
     else {
          // error
catch (IOException ex){ex.printStackTrace();}rykk
Message was edited by: a dummy
rykk.

Similar Messages

  • How to delete duplicate data that generated from csv file??

    The thing i have done is that i red all the data in the csv file without removing the duplicate data and display it.. For where i should have a known number of index (about 13), my main file should have 13 records no duplicate values. and how can my Java program update the corresponding record in the main file each time an index is updated??
    Hope somebody can assist me on this..it would be really helpful for me...
    Thank you.
    -Rao-
    Edited by: reemarao on Apr 1, 2010 3:58 AM

    Hi Sudhir,
    In case you have edit access in your system carry out the following procedure:
    1. Create an export datasource on your cube.
    2. Now create the update rules to your cube using the datamart Infosource.
    3. In the update rules multiply all the key figures by
    -1.
    4. Now create an infopackage and give the request id of the duplicate request as selection.
    5. Load the datamart request and do the data validation.
    If you do not ahve edit access there is no other alternative you would have to delete all the data and reconstruct the requests that you need.
    Bye
    Dinesh

  • How GET Output to Excel with Oracle9i Report using OC4J

    how GET Output to Excel with Oracle9i Report using OC4J.
    I FINISHED THE SETPS CONCIDERING THE JSP CODE NEEDED TO GET THE EXCEL OUTPUT ON LOCAL MACHINE.
    I NEED TO PUBLISH THIS REPORT THROUGH APPLICATION SERVER.
    THE QUESTION IS:
    1- HOW TO START AN OC4J INSTANCE FROM ORACLE 9I DS FOR THIS REPORT?
    2- WHERE (PATH) TO PUBLISH THE REPORT ON THE APPLICATION SERVER?
    3- WHAT IS THE DEFAULT URL TO RUN THIS REPORT AND WHERE TO PUT IT?
    4- HOW TO MAKE MAPPING FOR DIRECOTRY PATH TO TRANSLATED AS URL FOR THIS REPORT?
    5- IF ANY ONE CAN GIVE ME THE FULL CODE TO RUN AND CALL SIMPLE JSP REPORT TO BE VIED IN INTERNET EXPLORER.
    THANK YOU

    Hi,
    I can't answer to all your questions, however I can tell you that:
    2) The directory where to put the report file is specifiend in a file named
    <serverName>.conf
    in the sourceDire property
    <property name="sourceDir" value="/directory/dove/mettere/i/report"/>
    that you can find under ORACLE_HOME/reports/conf
    3) The URL is
    http://<server IAS address>:<port number>/<jsp file path>/<repName>.jsp?server=<report server name>&userid=<user>/<pwd>@<DB conn string>[&<param>=<valore>[&...]]
    5) In IE you have only to set the previous URL in the address bar.
    Hope this helps you
    Bye
    Raffy

  • BCP queryout -w generating wrong CSV File

    I'm trying to generate a CSV file with BCP. My problem is that I have some NVARCHAR columns so I must use the parameter -w for the bcp utility. So, the CSV file generated is opening in a single column in EXCEL. If I create a new text file copy the content
    of the CSV generated and paste in the new file and then change its type to CSV it works and open the content spread in different columns. Has someone seen it before? Thanks
    SET @File = 'MyQuery.csv'
    set @SQL = 'bcp "SELECT FirstName, LastName, DwellingName FROM Table" queryout "' + + '" -w -t "," -T -S '+ convert(varchar,@@ServerName)
    exec master..xp_cmdshell @SQL

    Hi,
    I agree with you. It seems the text was attached with some text attribute when generated by BCP. When I copy the content to Notepad, I notice each rows were enclosed in double quotes. Image:
    The double quotes make Excel think it is a unit. If I remove the double quotes and import the data to Excel, it will copy the text to separate columns.
    1. On the Data tab, in the Get External Data group, click From Text. And follow the instructions in the
    Text Import Wizard.
    2. Under Original data type, choose Delimited, click Next.
    3. Select Tab. I can review the data in the bottom of the dialog box. Then, Next.
    Another option is to query the results to file and save it as csv file. Use the Text Import Wizard to import the csv file into Excel. Select Space option in the step 3.
    Thanks.
    Tracy Cai
    TechNet Community Support
    Hi Tracy,
    I've found a solution for my problem:
    I've used the -CACP to generate the CSV file ANSI Encoded and it works!!!
    Now my command looks like: 
    SET @File = 'MyQuery.csv'
    set @SQL = 'bcp "SELECT FirstName, LastName, DwellingName FROM Table" queryout "' + + '" -c -CACP -t "," -T -S '+ convert(varchar,@@ServerName)
    exec master..xp_cmdshell @SQL

  • Help with output to 2 CSV files

    I created a script to parse through AD and output a list of computers that have certain info in the description field and it is working (wouldn't mind some critique if things could be done a better/faster way).  Now, what I am trying to do is split
    the output into 2 CSV files based on what is in the $descwho variable.  But I am not sure where to start (not looking for someone to rewrite the script but point me in the right direction).  I have tried a couple things but so far I have not gotten
    anywhere.
    Function Get-ScriptDirectory {
    if($hostinvocation -ne $null) {
    Split-Path $hostinvocation.MyCommand.path
    } else {
    Split-Path $script:MyInvocation.MyCommand.Path
    #Variable that provides the location of the script
    [string]$ScriptDirectory = Get-ScriptDirectory
    Function Clean-OU {
    #clean OU removes FQDN/RootOU from the start and $computername from the end of the OU string
    Param (
    $OriginalOU,
    $computer
    $ouArray = $OriginalOU.split("/")
    $newOU = $null
    Foreach ($OU in $ouArray) {
    If (($ou -ne "FQDN") -and ($ou -ne "RootOU") -and ($ou -ne $computer)){
    If (!$newOu) {
    $newOU = ".../$ou"
    } Else {
    $newOU += "/$ou"
    return $newOU
    $path = "$ScriptDirectory\ad_report_2.csv" #path to where report is saved
    Get-ADComputer -Filter * -Properties Description,Enabled,MemberOf,CanonicalName | % {
    $computer = $_.Name #name of computer
    $desc = $_.Description #description field associated with computer
    $DistinguishedName = Clean-OU -OriginalOU $_.CanonicalName -Computer $computer #FQDN/RootOU/PROD/WIN7/64bit/LT/PF-123456
    # is PC in the SpecialGroup security group?
    If ($_.memberof -match "SpecialGroup"){[string]$memberOf = "SpecialGroup"}else{$memberOf = "N/A"}
    If ($desc){#if Desc = true
    If (($desc.StartsWith("AEHT")) -or ($desc.StartsWith("VF-")) -or ($desc.StartsWith("Disabeled:"))) {
    $descArr = $desc.Split(":").Trim()
    $descWho = $descArr[0]
    $description = $descArr[1]
    $dwTemp = $descArr[2]
    If ($dwTemp -match "\[IT Support\]"){$dwPrefix = "IT Support"}
    elseif($dwTemp -match "\[App Dev\]"){$dwPrefix = "App Dev"}
    elseIf($dwTemp -match "\[Business\]"){$dwPrefix = "Business"}
    $dwTemp = $dwTemp -replace "\[IT Support\]" -replace "\[App Dev\]" -replace"\[Business\]"
    $descWhen = "$dwPrefix - $dwTemp"
    Write-Host $Computer -NoNewline
    #Write-Host - $memberOf -NoNewline
    #Write-Host - $enabled -NoNewline
    Write-Host - $descWho -NoNewline
    Write-Host - $description -NoNewline
    Write-Host - $descWhen -NoNewline
    Write-Host
    $Record = @{"Computer" = $Computer}
    $record.add("DescByWho",$descWho)
    $record.add("Description",$description)
    $record.add("DescWhen",$descWhen)
    $record.add("OU",$DistinguishedName)
    $record.add("MemberOf",$memberof)
    New-Object PSObject -Property $record |Sort-Object -Property DescByWho | Select Computer, DescByWho, Description, DescWhen, MemberOf, OU
    } | export-csv -path $path -NoTypeInformation

    Hi Mike,
    If you want to divide the output to two csv files based on the variable $descWho, please refer to this script, please also note I havn't tested:
    #modify
    $path1 = "$ScriptDirectory\ad_report_1.csv" #path to where report is saved
    $path2 = "$ScriptDirectory\ad_report_2.csv" #path to where report is saved
    $output1=@()
    $output2=@()
    #modify
    Get-ADComputer -Filter * -Properties Description,Enabled,MemberOf,CanonicalName | % {
    $computer = $_.Name #name of computer
    $desc = $_.Description #description field associated with computer
    $DistinguishedName = Clean-OU -OriginalOU $_.CanonicalName -Computer $computer #FQDN/RootOU/PROD/WIN7/64bit/LT/PF-123456
    # is PC in the SpecialGroup security group?
    If ($_.memberof -match "SpecialGroup"){[string]$memberOf = "SpecialGroup"}else{$memberOf = "N/A"}
    If ($desc){#if Desc = true
    If (($desc.StartsWith("AEHT")) -or ($desc.StartsWith("VF-")) -or ($desc.StartsWith("Disabeled:"))) {
    $descArr = $desc.Split(":").Trim()
    $descWho = $descArr[0]
    $description = $descArr[1]
    $dwTemp = $descArr[2]
    If ($dwTemp -match "\[IT Support\]"){$dwPrefix = "IT Support"}
    elseif($dwTemp -match "\[App Dev\]"){$dwPrefix = "App Dev"}
    elseIf($dwTemp -match "\[Business\]"){$dwPrefix = "Business"}
    $dwTemp = $dwTemp -replace "\[IT Support\]" -replace "\[App Dev\]" -replace"\[Business\]"
    $descWhen = "$dwPrefix - $dwTemp"
    Write-Host $Computer -NoNewline
    #Write-Host - $memberOf -NoNewline
    #Write-Host - $enabled -NoNewline
    Write-Host - $descWho -NoNewline
    Write-Host - $description -NoNewline
    Write-Host - $descWhen -NoNewline
    Write-Host
    $Record = @{"Computer" = $Computer}
    $record.add("DescByWho",$descWho)
    $record.add("Description",$description)
    $record.add("DescWhen",$descWhen)
    $record.add("OU",$DistinguishedName)
    $record.add("MemberOf",$memberof)
    #modify
    New-Object PSObject -Property $record
    if($descWho -like "a*"){ #use if statement to filter the $descwho begin with "a" character
    $output1+=New-Object PSObject -Property $record}
    else{
    $output2+=New-Object PSObject -Property $record}
    $output1|Sort-Object -Property DescByWho | Select Computer, DescByWho, Description, DescWhen, MemberOf, OU|export-csv -path $path1 -NoTypeInformation
    $output2|Sort-Object -Property DescByWho | Select Computer, DescByWho, Description, DescWhen, MemberOf, OU|export-csv -path $path2 -NoTypeInformation
    Best Regards,
    Anna Wang

  • How to automatically generate build.xml file in eclipse?

    Hello every body,
    I am learning about ANT. e.g I have writen a very simple programme which displays output "no worries". But how can I compile it with ANT and how can I generate build.xml file using eclipse.

    This is not really a Java issue but rather is an Eclipse issue. You may wish to look for their support sites or forums.

  • How do I generate a dbml file?

    How do I generate a dbml file?
    In a Visual Studio file, A project contains a DBML file that, when opened, shows a very cool representation graphical of a database and all the interconnections between the tables.
    I want that for another project for documentation purposes.  The database already exists.  So how do I get from the sql server database with all the key relationships and the proverbial whole nine yards to the cool graphic represenataion of ta
    DBML file as seen in visual studio.
    I did some searching on the internet with several search engines and so far everything I see is working in the other direction such as "create database from DBML file? "

    I guess database creation is needed, you may check below link, if help
    http://msdn.microsoft.com/en-us/library/bb546179(v=vs.110).aspx
    Please click the Mark as answer button and vote as helpful if this reply solves your problem

  • Issue while generating a CSV file through Oracle.

    Hi,
    I am generating a CSV file using oracle stored procedure.
    In an Oracle procedure I need to create a CSV file, which contains the data of a select query, and then emailing this file. Problem is that one of the field contains comma eg ('ABC,DE'). Now in the CSV file 'ABC' is shown in the one cell and 'DE' is shifted to the adjacent cell which is not required..
    Thanks.

    Hi Welcome,
    If you data contains comma then make ~ as your delimeter.
    or repalce all the commas form your data.
    select replace(column_name,',','') from table_name; /* before writing to the file */Regards,
    Bhushan

  • Column heading is not coming while generating a .csv file from .sql file

    Hi all,
    Now since I am able to generate a .csv file by executing my .sql file, the column heading is missing in that. Please advise. I have used the following parameters in my query:
    set linesize 1000
    set colsep ','
    set echo off
    set feedback off
    set pagesize 0
    set trimspool on
    spool /path/file.csv
    select ...... from .... where .....;
    spool off
    exit

    set pagesize 0 <-- your problem
    you must set it into a high value (max value 50000)
    see:
    SQL> select * from dual;
    D
    X
    SQL> set pagesize 0
    SQL> select * from dual;
    X
    SQL> set pagesize 50000
    SQL> select * from dual;
    D
    X

  • How I could generate an XML file from a report in version 4.0B

    Good morning,
    How could I generate an XML file from a report? Please note that I am using version 4.0B
    I don't have access to
    Billy Vital

    Hi,
            In the Class CL_XML_DOCUMENT,
                 we have a method  EXPORT_TO_FILE to download an XML file.

  • How to output data to a file in SCC-SG04?

    I am using SCC-2345 with SCC-SG04 connected to NI-6221 in Windows 2000 in VC6.
    How to output data to a file like data1.dat in VC6 or in Labwindows/CVI?

    Hello mwibm,
    If you just want to do file input/output in LabWindows/CVI, I would take a look at the Formatting and I/O CVI library or the ANSI File I/O functions. For example, if you just want to write an array of data to a file, I would look at the ArrayToFile function or the fwrite/fputs/fprintf ANSI C functions included in stdio.h. The ANSI C functions will also work in Visual Studio. More information on the LabWindows/CVI File I/O functions can be found in CVI help, and more information on ANSI C functions can be found in CVI Help and online at various websites.
    Maybe you could further clarify what problems you are having and what kind of data you want to write to a file.
    Thanks.
    Wendy L
    LabWindows/CVI Developer Newsletter - ni.com/cvinews

  • How do I generate the pdf file using the name of a field.  How can I help

    how do I generate the pdf file using the name of a field.  How can I help

    Hi,
    here's a sample.
    LiveCycle Blog: Formulare in bestimmte Verzeichnisse speichern und nach Inhalt aus Formularfeld benennen //Save forms to…

  • How can I store my music files on an external hard drive and listen to them through iTunes that way?

    How can I store my music files on an external hard drive and listen to them through iTunes that way? At the moment they're both on the external hard drive and also stored on the computer but I'm quickly running out of memory on my iBook G4 so I'd like to only keep them on the external hard drive and, if possible, delete them from my computer's hard drive. At the moment, when the hard drive isn't plugged in a lot of the files won't play and I get the exclamation mark next to the particular song in iTunes, but everything plays fine when the hard drive is plugged in.
    Thank you.

    Sounds like your files are playing from the external drive already.  To check go to iTunes - Preferences - Advanced and check the Media Folder Location.  Change it to the external drive if you need to.

  • How to combine a few PDF files into one with Adobe reader?

    how to combine a few PDF files into one with Adobe reader?

    Hi aho,
    You would need either Acrobat (link to free 30 day trial) or our PDF Pack subscription service to perform that task.
    What can I do with Reader?
    Let me know if you have further questions!
    Regards, Stacy

  • Why do I get the error message: "The file "iTunes Library" cannot be read because it was created by a newer version of iTune." I am using iTunes9.1.1 which, I believe, is the highest for OS 10.4.11 ?

    Why do I get the error message: "The file "iTunes Library" cannot be read because it was created by a newer version of iTune." I am using iTunes9.1.1 which, I believe, is the highest for OS 10.4.11 ?

    Hello,
    Did you reinstall lately?
    My 10.4.11 Drive seemes to have iTunes 7.6.2 on it, have you tried Software update to see if iTunes is listed?
    Another 10.4.11 drive has iTunes 6.05 on it... I hate upgrading iTunes, seems worse at every upgrade.
    The 10.5.8 drive I'm booted from now has iTunes 8.02 on it.

Maybe you are looking for