Export to csv with no duplication in records
how can i export from a table to a CVS file with no duplications in writing?
REGARDS
I HAVE THIS QUERY I NEED HELP ON IT
select iden_username, name , object_name from identification, groups, objects
order by iden_username
I WANT A RESULT FOR ALL NOT ALL THE RESULTS POSSIBLE
I also want to help you but i cannot help you unfortunately.
Regards
Raj
Similar Messages
-
Error exporting to CSV with groups
Post Author: HuskerSkip
CA Forum: Exporting
Iu2019m having a problem exporting reports to the CSV format. Iu2019m seeing the problem both in the report designer and in my C# code. Here are the conditions under which the problem appears:
Report contains at least one group.
Report Header & Footer, Page Header & Footer, and Group Headers are all suppressed. Only Details is visible.
Selection Formula is such that it returns no records.
When I export the report as CSV from the report designer I get this error: u201CFailed to export the report.u201D
When I export from my C# code, I get this error: u201CError in File C:\DOCUME~1\...EBDF30}.rpt: Operation not yet implemented.u201D
If the Selection Formula is such that it returns records, then everything works fine. Other extract formats also work fine. It only seems to be CSV with an empty dataset that has the problem.
Has anyone else run into this problem? If so, are there any workarounds?
Thanks,
Skip
CR XI R2 SP3 Developer Full
C# 2.0
Visual Studio 2005I wouldn't think it would be a problem. Are you sure you have write permission where you want to save the PDF?
-
Export to csv with blank row error apex 4.0.2
In a tabular form when I use the export to csv, it return a csv file and the data is fine but there is a blank row between the header and the first row of data.
It happens in the 4.0.2 release. I used the 3.1.2 release before and it worked perfect.
It is a bug? any idea to fix it? I want to avoid the manual export because it's a complex query with agrupation levels.
Thank you!An easy solution to formatting columns as text in Excel exporting (even handles leading zeros properly). In the report SQL do the following code:
For Interactive reports:
decode(:REQUEST,'CSV','="'||your_column||'"',your_column) your_column_name,
For Standard reports:
decode(INSTR(NVL(:REQUEST,'FOO'),'FLOW_EXCEL'),0,your_column,'="'||your_column||'"') your_column_name,
Interactive report example
select address1,
address2,
city,
state,
decode(:REQUEST,'CSV','="'||zip_code||'"',zip_code) zipcode
from your_table
Standard report example
select address1,
address2,
city,
state,
decode(INSTR(NVL(:REQUEST,'FOO'),'FLOW_EXCEL'),0,zip_code,'="'||zip_code||'"') zipcode
from your_table
This will work without modification if users modify and save an interactive report as well. -
How to export a table with near 1 billion records in 9i
Hi,
I would like to ask your inputs on exporting a very large table (rows approximately nearing 1 billion).
What are the parameters and its values to have an acceptable export time?
Thanks in Advanceuser13380363 wrote:
Hi,
I would like to ask your inputs on exporting a very large table (rows approximately nearing 1 billion).
What are the parameters and its values to have an acceptable export time?Just in case there might be an alternative - what are you trying to accomplish?
(In other words, is export the correct tool for your job?)
Note that it MIGHT be the right tool. However, based on experience, that is not a foregone conclusion until we understand what your end goal is intended to be. -
Create export-csv with dynamic (unknown amount) columns
Hi,
This is my first post, hopefully I include everything you need. My code block is at the bottom of my post.....
I have written a PS script that gives me the info I need, but I would like to format it differently. Currently I import a CSV with 2 columns - username and print queue name. The script then takes each username and looks it up in SCCM
to find the workstations the username has logged into. I then export to csv - this is where I would like to format it differently. The export csv has 4 columns username, print queue name, workstation name, and details.
username1,printqueue,workstation1,details
username1,printqueue,workstation2,details
username2,printqueue,workstation1,details
username2,printqueue,workstation2,details
My problem is that if the user logs into 5 workstations I have 5 rows with duplicated username and print queue name. If my next username logs into 8 workstations I have 8 rows, etc. I would like to format the export dynamically using as many
columns (not rows) as need. For example
username1, printqueue,workstation1,workstaion2, workstation3
username2,printqueue,workstation1,workstation2, workstation3,workstation4
I expect where I have my pscustomobject would be where I could change this - I have tried setting up a count variable and using that in my loop to be able to assign dynamic column name, I have tried using an array but still new to setting that up, maybe
I just wasn't doing it correctly. If anyone has any ideas that would be great.
Thanks, Kevin
Here is my code:
#Declare variables
$now = Get-date
$date = get-date -uformat "%Y_%m_%d_%I%M%p"
$Queues = Import-Csv "c:\Users.csv"
$SiteName="XXX"
$SCCMServer="your.sccm.server.com"
$SCCMNameSpace="root\sms\site_$SiteName"
$CSVPath1 = "c:\PrinterUsersByComputer_$date.CSV"
#Notify user that script is starting
Write-Host -ForegroundColor Green "Starting script"
#Loop through each account and find any workstations from SCCM that the user has logged into
foreach ($Queue in $Queues){
$Queue.Username
$WSs = Get-WmiObject -namespace $SCCMNameSpace -computer $SCCMServer -query "select Name from sms_r_system where LastLogonUserName = '$($queue.username)'" | Select-Object -ExpandProperty Name
#Check if the workstation variable has data
if ($WSs){
foreach ($WS in $WSs) {
#Check if workstation is ALIVE and if we have access to it to get OS version
$rtn = (Test-Connection -Cn $WS -BufferSize 16 -Count 1 -Quiet)
IF ($rtn -match 'True') {
$OS = Get-WmiObject Win32_OperatingSystem -ComputerName $WS | Select-Object -ExpandProperty Caption -ErrorAction Stop
#Write to screen device to show progress
Write-Host -ForegroundColor Green "Computer information found: $WS"
#Write to log file the username, workstation(s) logged into, and OS version
[PSCustomObject] [Ordered] @{
'UserName' = $Queue.Username
'Print Queue' = $Queue.PrintQueue
'ComputerName' = $WS
'Operating System' = $OS
} | Export-Csv $CSVpath1 -Append -NoTypeInformationOk, just a sec, I'm not sure we are on the same page. I don't think that isn't what I'm look for. Unless I'm missing something, your code above assume 4 workstation columns for every row. What if there is 5 or 8. My current output
from the full script is this (based on checking if PC is pingable, whether I'm denied the WMI query, etc)
UserName
Print Queue
ComputerName
Operating System
User1
PQ1
Computer1
Microsoft Windows 7 Enterprise
User1
PQ1
Computer2
Microsoft Windows 7 Enterprise
User1
PQ1
Computer3
Microsoft Windows 7 Enterprise
User1
PQ1
Computer4
Microsoft Windows 7 Enterprise
User1
PQ1
Computer5
Microsoft Windows 7 Enterprise
User1
PQ1
Computer6
Microsoft Windows 7 Enterprise
User1
PQ1
Computer7
Microsoft Windows 7 Enterprise
User1
PQ1
Computer8
Microsoft Windows 7 Enterprise
User1
PQ1
Computer9
Microsoft Windows 7 Enterprise
User1
PQ1
Computer10
Microsoft Windows 7 Enterprise
User1
PQ1
Computer11
Microsoft Windows 7 Enterprise
User1
PQ1
Computer12
Microsoft Windows 7 Enterprise
User1
PQ1
Computer13
No device name to query
User1
PQ1
Computer14
Microsoft Windows 7 Enterprise
User2
PQ2
Computer15
Microsoft Windows 7 Enterprise
User3
PQ3
Computer1
Microsoft Windows 7 Enterprise
User4
PQ4
Computer2
Access denied connecting to device. No access to it: Computer2
What I would really like is this, getting rid of the OS name for now:
User1
PQ1
Computer1
Computer2
Computer3
Computer4
Computer5
User2
PQ3
Computer1
User3
PQ13
Computer1
Computer2
I would just like to condense the workstations to columns instead of 1 workstation per row and be able to expand the # of columns required based on the amount of workstations in $WSs - -
Hi, i get the error -49 when trying to Export a Movie edited in iMovie and recorded with Elgato Video Capture anyone know why i get this Error and can help me?
Read this
http://support.apple.com/kb/ts1583 -
Exporting Numbers file with leading zeros as csv file
When I export a list of mobile phone numbers with leading zeros (086* etc.) from Numbers as a csv file, the leading zeros are stripped out, although the cells are previously formatted as text. What can I do about this?
"When I export a list of mobile phone numbers with leading zeros (086* etc.) from Numbers as a csv file, the leading zeros are stripped out, although the cells are previously formatted as text. What can I do about this?"
Well, the first thing you could do would be to post your question in one of the forums for Numbers.
Click Discussions to get to the Discussions index page, then the section for the version of iWork you're using, then the Numbers forum in that section.
In AppleWorks (which doesn't offer an opportunity to Save as or Export as csv) I'd force the application to see the phone numbers as text by inserting some non-numeric characters into the string of digits.
Examples: 000-123-4567, 000 123 4567
It may also be a function of the application you are using to open the csv file.
When I did a brief test of the suggestion above with Numbers '09, I got this result on opening the file in Text Edit:
,1234567890,num
,123-456-7890,tex
,0123456789,num
,012-345-6789,tex
,0001234567,num
,000-123-4567,tex
Note that both the examples entered as a string of digits only (num) and those entered with inserted hyphens (tex) kept the leading zeroes. Cell format for the column containing the phone numbers was set to Text.
Regards,
Barry -
Exporting BI Publisher 11g ouput to Excel 2007 with over 65,000 records
Hi All,
I have seen information that BI Publisher 11.1.1.5 allows sending BI Publisher reports directly into native Excel 2007. Will this automatically allow reports with over 65,000 records to be saved in a single Excel 2007 sheet? If so, is it possible to do this in BI Publisher 11.1.1.3 which I am currently using or must I upgrade to 11.1.1.5 to get this functionality?
Will BI Publisher 11.1.1.5 also work with Excel 2010 to be able to load reports with over 65,000 records into a single Excel 2010 sheet?
Thanks for any information that will help me find a solution to this issue.
Barrywell, i did some research, and indeed, to be able to output as .xlsx you would need an update to 11.1.1.4, as it is the first one which supports Excell 2007/10.
*[url http://www.java-forums.org/blogs/advanced-java/collection/]Java collection* -
10g exporting to CSV using client_text_io is not working correctly.
I have an odd issue which i could do with some help with. I run an function that exports to CSV based on an pre defined record group.
This has been working fine for many months with various customers. Recently a new customer used it and they have 28k rows in his record group and the export is actually not exporting correctly.
The record group has a record count of 28331.
The CSV produced has only 3756 in my CSV file. These are the last 3756 records in the Record group so its as if its overwriting the data as it goes yet all smaller datasets work
FUNCTION fun_export_csv (vgraphid NUMBER, p_filename VARCHAR2)RETURN BOOLEAN IS
out_file client_text_io.file_type;
i NUMBER;
lv_line VARCHAR2(5000);
BEGIN
rg:=populate_group('RG11_EXP');
synchronize;
lv_line:= ('"GIN","Gin Date","PO Num","PO Required Date","Mat Num","Mat Description","Supplier Part No","On Time Delivery(Yes-1, No-0)"');
client_text_io.put(out_file, lv_line);
client_text_io.new_line(out_file,1);
For i in 1..get_group_row_count('RG11_EXP') Loop--this count is 28331
lv_line:= ('"'||get_group_number_cell('RG11_EXP.col1', i ) ||'"'|| ',' ||'"'||
get_group_date_cell('RG11_EXP.grn_date', i ) ||'"'|| ',' ||'"'||
get_group_number_cell('RG11_EXP.po', i ) ||'"'|| ',' ||'"'||
get_group_date_cell('RG11_EXP.daterqd', i ) ||'"'|| ',' ||'"'||
get_group_char_cell('RG11_EXP.item_no', i ) ||'"'|| ',' ||'"'||
get_group_char_cell('RG11_EXP.desc', i ) ||'"'|| ',' ||'"'||
get_group_char_cell('RG11_EXP.part_no', i ) ||'"'|| ',' ||'"'||
get_group_number_cell('RG11_EXP.ontime', i ) ||'"');
client_text_io.put(out_file, lv_line);
client_text_io.new_line(out_file,1);
END LOOP;
client_text_io.FCLOSE(out_file);
RETURN TRUE;Hello,
Try to insert a "synchronize" instruction from time to time:
i pls_integer := 1;
Loop
If mod(i, 500) = 0 Then
synchronize;
End if ;
i := i + 1 ;
End loop;
...<p>But keep in mind the the CLIENT_TEXT_IO generate a lot of network traffic, so it is better and faster to generate the file on the A.S., then after transfer it to the client machine.</p>
Francois -
Export Data- csv Extremely Slow
I am using SQL Developer 1.5.1 Build MAIN-5440 on Mac OS X 10.5.5 and the Export Data=>csv command is taking 20 minutes to show the file dialogue window. The query takes the expected amount of time and once I choose to save the file the remaining records are retrieved and the file is saved quickly. Anyone know of a workaround for this bug?
Thanks,
JasonAs discussed above, there is a bug in the SQL Developer export (since the initial 1.0 release from what I have seen) where the query is executed again (just fetching the first 50 records - not all of them) before the export dialog is displayed. This means that if your statement took 10 minutes to query the first 50 records when you first executed it, then it will take another 10 minutes between selecting the export option and the dialog being displayed. If your statement took a second to query the first 50 records, then it will take only another second between selecting the export option and the dialog being displayed.
Ordinarily, I would suggest that you upgrade to the current version (1.5.3) from 1.2, but 1.5.3 has other problems with the export sometimes not working. The export problems in 1.5.3 are not in 1.5.1, but even 1.5.1 has the bug where the export reruns the query before displaying the export dialog.
theFurryOne -
How export to csv work in safari browser?
In my application export to csv open like a raw data in new tab.
But other browsers working great!.
Need to open in a csv file or save it as a csv file.
Please suggest me. Thank you in advance!.Hi Adrian,
Why don't you try any another software for opening CSV files then Notepad ? According to my experience, you can use these softwares to open an CSV files and they are:-
Microsoft Excel
Open Office Calc
Google Docs
Also there is an additional tool available known as CSV viewer. You may try this, download it from here http://www.csvviewer.com/
I've never used Notepad for opening CSV files, because sometimes it contains some symbols which are not not at all compatibile with Notepad.
Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread. -
Exporting to CSV Displays Different Information
I am working on a script to show me the size of every mailbox in the company. I want to export this information to a CSV so I can sort and keep it offline. Below are my various scripts that I have tried with an explanation of what happens when I use it.
1. Get-Mailbox | Get-MailboxStatistics | where {$_.ObjectClass –eq “Mailbox”} | Sort-Object TotalItemSize –Descending | ft @{label=”User”;expression={$_.DisplayName}},@{label=”Total Size (GB)”;expression={$_.TotalItemSize.Value.ToGB()}},@{label=”Items”;expression={$_.ItemCount}},@{label=”Storage
Limit”;expression={$_.StorageLimitStatus}} > e:\tmp.csv
With this script I get the correct info in the format I want, but it ignore the commas and everything ends up in column A. Making it to where I cannot sort it.
2. Get-Mailbox | Get-MailboxStatistics | where {$_.ObjectClass –eq “Mailbox”} | Sort-Object TotalItemSize –Descending | ft @{label=”User”;expression={$_.DisplayName}},@{label=”Total Size (GB)”;expression={$_.TotalItemSize.Value.ToGB()}},@{label=”Items”;expression={$_.ItemCount}},@{label=”Storage
Limit”;expression={$_.StorageLimitStatus}} | Export-csv -Path e:\mailboxsize.csv -NoTypeInformation -Delimiter ","
With this script I get "ClassID" information and nothing that I need. However, when I remove everything after the last pipe (the Export-csv section) then all the information displays correctly in powershell.
3. Get-Mailbox | Get-MailboxStatistics | ft DisplayName,TotalItemSize,ItemCount | export-csv e:\test.csv -notypeinformation -delimiter ","
With this script I tried to go basic, since I read that you cannot pre-format a CSV export. I also tried it without the -Delimiter switch. Both give me the same results as script #2
4. Get-Mailbox | Get-MailboxStatistics | ft DisplayName,TotalItemSize,ItemCount > e:\tmp.csv
Tried the basic approach with the > instead of export-csv and I get the same results as script 1, just not sorted.
Can someone tell me what I am missing to make Powershell see my commas and give me the correct data when using Export-CSV?
Thanks!Hi,
Don't use the Format-* cmdlets if you want to do anything else with the data. In your case, try replacing ft with Select-Object.
EDIT: As an example, here's your #4:
Get-Mailbox |
Get-MailboxStatistics |
Select DisplayName,TotalItemSize,ItemCount |
Sort DisplayName |
Export-Csv .\mbxStats.csv -NoTypeInformation
Don't retire TechNet! -
(Don't give up yet - 12,950+ strong and growing) -
Report output Export to CSV issue
Hi Experts,
I have a Bex Query. After running the report when I export the report in CSV format using "Export to CSV" from the report output screen, the data
is being dumped in different columns And when i try to convert that particular CSV file to Excel as we can only select one single column for delimiting the values using a separator into different cells the data in the other column is being truncated.
Kindly suggest me how to resolve this.
Thanks in Advance,
SushmaHi,
(If anything else on the BW side doesn't help).
Not so long ago I had a similiar problem all data (originally taken from several columns) were in one column - solved it with the help of VB coding.
Sth like this could help you.
Regards, Leszek
Dim tekst As String
last_row = Selection.SpecialCells(xlCellTypeLastCell).Row
Range("A1:Z" & last_row).Select
Cells.Select
Selection.NumberFormat = "@"
For wiersz = 1 To last_row
Cells(wiersz, 1).Select
tekst = Selection.Value
Cells(wiersz, 1).Value = Left(tekst, 21)
Cells(wiersz, 2).Value = Right(Left(tekst, 27), 6)
Cells(wiersz, 3).Value = Right(Left(tekst, 37), 10)
Cells(wiersz, 4).Value = Right(Left(tekst, 50), 13)
Next wiersz -
Problem while exporting to PDF with japanese character in Crystal Report X1
Hi,
I am using Crystal report X1 with classic ASP on a Windows 2003 Enterprise Server, SP 2. In my application, I have to export the report into PDF, CSV, DOC formats. I am have Japanese strings in the report. While exporting to PDF, empty boxes has displayed in the place of Japanese string and in CSV file, question mark has been displayed instead of Japanese string. But the Doc file is exported correctly. I have not installed any language support software either in server or in client machine. I have used MS Gothic and Arial Unicode MS fonts for the text-objects which has Japanese strings.
Please give me a solution so that I will get PDF file with Japanese strings instead of empty box or question mark.
Do I need to install any language support pack software?
Thanks in advance.
Regards,
ManjuHi Don,
Thank You for your reply. I have resolved the issue of exporting to pdf from crystal report X1 having Japanese data after installing the language pack.
But when I am exporting to CSV or TXT, i am getting ??? instead of Japanese characters. I have tried "export" through crystal report designer and got ??? instead of Japanese.
The Crystal report version I am using is Crystal report X1 11.0.0.1282
Crystal Report Desinger is installed in Windows Xp machine
Font set for Text object is Arial Unicode MS, MS PMincho, MS PGothic
Does the Crystal report X1 11.0.0.1282 has the UTF-8 support for CVS / txt
Please provide me a solution
Thanks in advance,
Regards,
Manju -
After installed SP1 for SQL Server 2012, can no longer export to csv
After installing SP1 today via Windows Update, I am no longer able to export data to csv using the SQL Server Import and Export wizard. I get the following error message:
"Column information for the source and the destination data could not be retrieved, or the data types of source columns were not mapped correctly to those available on the destination provider."
"Column "col1": Source data type "200" was not found in the data type mapping file."...
(The above line repeats for each column)
The work-around I have to do is to manually map each column in the "Edit Mappings..." option from the "Configure Flat File Destination" page of the wizard. This is an extreme inconvenience to have to have to edit the mappings and change
each column to "string [DT_STR]" type from "byte stream [DT_BYTES]" type each time I want to export to csv. I did not have to do this before installing SP1; it worked perfectly for months with hundreds of exports prior to this update and
no need to modify mapping.I am running Windows 7 64-bit, SQL Server 2012 Express edition. Again, just yesterday from Windows Update, I installed SQL Server 2012 Service Pack 1 (KB2674319), followed by Update Rollup for SQL Server 2012 Service Pack 1 (KB2793634). This situation was
not occurring before these updates were installed, and I noticed it immediately after they were installed (and of course I restarted my computer after the updates).
In SSMS I just now created a test DB and table to provide a step-by-step with screenshots.
Here is the code I ran to create the test DB and table:
CREATE DATABASE testDB;
GO
USE testDB;
GO
CREATE TABLE testTable
id int,
lname varchar(50),
fname varchar(50),
address varchar(50),
city varchar(50),
state char(2),
dob date
GO
INSERT INTO testTable VALUES
(1,'Smith','Bob','123 Main St.','Los Angeles','CA','20080212'),
(2,'Doe','John','555 Rainbow Ln.','Chicago','IL','19580530'),
(3,'Jones','Jane','999 Somewhere Pl.','Washington','DC','19651201'),
(4,'Jackson','George','111 Hello Cir.','Dallas','TX','20010718');
GO
SELECT * FROM testTable;
Results look good:
id lname fname address city state dob
1 Smith Bob 123 Main St. Los Angeles CA 2008-02-12
2 Doe John 555 Rainbow Ln. Chicago IL 1958-05-30
3 Jones Jane 999 Somewhere Pl. Washington DC 1965-12-01
4 Jackson George 111 Hello Cir. Dallas TX 2001-07-18
In Object Explorer, I right-click on the [testDB] database, choose "Tasks", then "Export Data..." and the SQL Server Import and Export Wizard appears. I click Next to leave all settings as-is on the "Choose a Data Source" page, then on the "Choose a Destination"
page, under the "Destination" drop-down I choose "Flat File Destination" then browse to the desktop and name the file "table_export.csv" then click Next. On the "Specify Table Copy or Query" page I choose "Write a query to specify the data to transfer" then
click Next. I type the following SQL statement:
SELECT * FROM testTable;
When clicking the "Parse" button I get the message "This SQL statement is valid."
On to the next page, "Configure Flat File Destination" I try leaving the defaults then click Next. This is where I am getting the error message (see screenshot below):
Then going to the "Edit Mappings..." option on the "Configure Flat File Destination" page, I see that all columns which were defined as varchar in the table are showing as type "byte stream [DT_BYTES]", size "0", the state column which is defined as char(2)
shows correctly however with type "string [DT_STR]", size "2" (see screenshow below):
So what I have to do is change the type for the lname, fname, address and city columns to "string [DT_STR]", then I am able to proceed with the export successfully. Again, this just started happening after installing these updates. As you can imagine, this
is very frustrating, as I do a lot of exports from many tables, with a lot more columns than this test table.
Thanks for your help.
Maybe you are looking for
-
10.6.5 down load
After downloading 10.6.5. I noticed when I log on hotmail, it goes straight to my account settings window. I find this a bit weird, but not to worrying. Have not noticed any other changes or problems. Would any know why this hotmail change is happeni
-
My mini ipad is blocking while connecting with itunes. I do?
my mini ipad is blocking while connecting with itunes. I do?
-
Hi guys, We got a standard SRM MDM catalog implementation with OCI configuration handling all the item mapping. I run into issues when I flag an item as a "Service Item" in MDM by using the default provided flag MDMSRM_SERVICE_ITEM. This flag, when s
-
Photoshop CS6 extended-Windows explorer crash
Hi! I run Photoshop CS6 extended, student edition and recently, I'm having an error every time I work with Photoshop. Windows Explorer doesn't respond. The screen freezes and it's lagging so much. My software is updated. Windows updates are done as
-
Hallo from where I can start to create a web guide like prima http://www.primagames.com/games/splinter-cell-blacklist/primaguides/747 Site is perfectly clear and usable. There is a top menu for site nav and a left side expandable menu to navigate con