As @MathiasR.Jessen mentioned in the comments: you need to expand the SamAccountName property to get just the value. Also, you're overwriting your output CSV with every iteration. Either append to the file, or move the Export-Csv cmdlet outside the loop. The former requires PowerShell v3 or newer, the latter requires...
I think the skip functionality is working, but only on the data rows - you're not using the skip in your header row, so all headers will be written. The fix is a 1 liner to ensure that the corresponding headers are skipped too: ... header = next(reader) header =...
As with this case, it seems likely that you are attempting to use copy from a computer other than the one which hosts your database. copy does I/O from the database host machine's local file system only. If you have access to that filesystem, you can adjust your attempt accordingly....
sql-server,stored-procedures,asp-classic,export-to-csv,bcp
I ended up going a completely different route. I created the CSV file from pure ASP code, only using the sproc to return the data.
python,csv,python-3.x,export-to-csv
You have to cast to any ints to string string before you can concat it to another and write to file. str(score) # <- file.write('Date, Question, Name, Score\n' + date + ',' question + ',' + name + ',' + str(score) + '\n') Or use str.format: with open("results.csv", "a") as...
postgresql,plpgsql,export-to-csv,postgresql-copy
Try this CREATE or replace FUNCTION exportdata() RETURNS void AS -- use void because you're not returning anything $$ DECLARE rec text; BEGIN FOR rec IN Select distinct t.products from trndailyprices as t LOOP EXECUTE -- you need to use EXECUTE Keyword format('Copy ( Select * from trndailyprices as t...
java,gwt,apache-poi,export-to-excel,export-to-csv
Create a HTTPServlet class, inside the doGet() method of the servlet create a HSSFWorbook using the Apache Poi jar, write your data in the sheet, write the workbook in the response part of servlet. Map the servlet in your web.xml file and finally, use this servlet url inside your button...
csv,export,export-to-csv,hybris
Yes you can! Using the includeExternalData method of ImpexReader. You can also use it with a CSVReader which is more customizable. With both solutions you have the possibility to set a linesToSkip parameter. You can set it to 1 assuming your header is in the first line. Don't forget to...
So, I have finally answered my own question. In case anyone else comes across this problem here is the answer. $idList = array(); foreach( $entry_id as $id){ if ((int)$id > 0) { $idList[] = (int)$id; } }//end foreach $sql = $wpdb->get_results( "SELECT * FROM $bp_table_name WHERE id IN(" . implode(",",...
The thing you can do in your case is to run Export-CSV with the -Append flag including the first time Your_Data_In_Pipe | Export-Csv Your_File.csv -Append -NoTypeInformation If you really want to remove the first line of your CSV file you can use : Get-Content Your_File.csv | select -Skip 1 |...
sqlite,shell,sqlite3,export-to-csv
After much studies and discussion, I found an answer that is working properly, echo -e ".separator ","\n.import /home/aj/ora_exported.csv qt_exported2" | sqlite3 testdatabase.db the main thing is, that I needed to include the path of the .csv file in the import statement....
Okay, took awhile because I had never worked with fileInput and downLoad buttons from Shiny before. Basically what I post below is probably close to what you wanted. It allows you to select a file to upload, and then choose a place to download it. I didn't build your summary...
angularjs,pagination,export-to-csv,angular-ui-grid
I ended up using csvExport function included with ui-grid. I added an "Export All" custom menu item and it works great! Here is my code: gridMenuCustomItems: [ { title: 'Export All', action: function ($event) { $http.get(url).success(function(data) { $scope.gridOptions.totalItems = data.totalFeatures; $scope.gridOptions.data = data.features; $timeout(function() { var myElement = angular.element(document.querySelectorAll(".custom-csv-link-location")); $scope.gridApi.exporter.csvExport(...
java,csv,export-to-csv,opencsv
You could specify the escape character to be '\0', which would stop OpenCSV from escaping your existing quotes: CSVWriter csvWriter = new CSVWriter(new OutputStreamWriter(System.out), ',', '\0', '\0'); csvWriter.writeNext(new String[] { "\"Header 1\"", "\"Header 2\"", "\"Header 3\"" }); csvWriter.writeNext(new String[] { "123.4", "234.6", "999.8" }); csvWriter.close(); Output: "Header 1","Header 2","Header 3"...
excel,datetime,csv,export-to-csv
Use Custom format as yyyy/mm/dd hh:mm:ss AM/PM in Type text box and save as csv should work
powershell,export-to-csv,user-profile
Try changing Format Table (FT) to a Select statement... so this: $userProfileProperties = $userProfile.Properties | sort DisplayName | FT DisplayName,Name,@{Label="Type";Expression={$_.CoreProperty.Type}} becomes: $userProfileProperties = $userProfile.Properties | sort DisplayName | select DisplayName,Name,@{Label="Type";Expression={$_.CoreProperty.Type}} ...
ruby,csv,formatting,string-formatting,export-to-csv
This is correct, a double quote is escaped with another double quote. From RFC 4180: If double-quotes are used to enclose fields, then a double-quote appearing inside a field must be escaped by preceding it with another double quote. For example: "aaa","b""bb","ccc" ...
Richard Having looked at the MySQL docs for data output what you are asking doesn't look like it it is possible. You have some options for data validation. Assuming you have some form of scripting knowledge you Amy be able to create an internal stored procedure that will output the...
The classic echo explode(',',$col) etc way is fine, but you can also write directly to the csv file using php's built in functions. $filename = 'test.csv'; $file = fopen($filename,"w"); if ($channels->num_rows() > 0) { foreach($channels->result_array() as $key => $row) { if ($key==0) fputcsv($file, array_keys((array)$row); // write column headings foreach ($row...
java,string,csv,blob,export-to-csv
from wikipedia : A comma-separated values (CSV) file stores tabular data (numbers and text) in plain text. So, you can't store anything else than text in a csv...
function,powershell,csv,export-to-csv,pipeline
If you want to accept pipeline input from advanced function, then it have to have parameters, which declared as ValueFromPipeline or ValueFromPipelineByPropertyName and does not bound from command line. function Out-Excel { param( [Parameter(Mandatory=$True,HelpMessage="Enter Prefix")] [string]$Prefix = $null, [Parameter(Mandatory=$True,ValueFromPipeline=$True)] [psobject]$InputObject = $null, $Path = "$env:temp\$Prefix`_$(Get-Date -Format yyMMdd_HHmmss).csv" ) begin{ $List=New-Object...
java,excel,export,export-to-csv
Most simple way would be to read all the rows from JTable and create a excel file using POI library. You can get the table data using below method which you can store in list or something : table.getModel().getValueAt(rowIndex, columnIndex); Now to create excel file you can use below code...
java,excel,apache-poi,export-to-csv
There is no point converting number back and forth to Strings as this shouldn't do any thing useful. Try doing listObjects.add(new BigDecimal(content[i-1])); with rounding you can do listObjects.add(new BigDecimal(content[i-1]).setScale(9, RoundingMode.HALF_UP)); though I suspect the rounding error has occurred before this point as this should do basically the same thing as...
A few ways to do such come to mind: 1) BCP 2) SSIS Package I am sure their are a few other ways to do this, but these are the ones that I have used....
php,csv,character-encoding,export-to-csv
It's all in the fputcsv() function: http://php.net/manual/en/function.fputcsv.php Try to choose the correct $delimiter, $enclosure and $escape_char. The default character that is used as the field-separator in excel is set by the locale settings. That means: Importing CVS files can be language dependent. Export to CSV from excel to see what...
powershell,csv,powershell-v2.0,powershell-v3.0,export-to-csv
You should not need to output to file with export-csv just to read the file back in to make a change. Lets output the data all at once without reading the back in again. $rep = $rep | ConvertTo-Csv -NoTypeInformation $title | Set-Content -Path $reportpath $rep | Add-Content -Path $reportpath...
First, lets debug your script. The problem why you get your desired result only for the first row is obvious if you follow your algorithm and take a closer look on php's file-handling. You are opening both files at the beginning of your script. PHP sets a file-pointer for each...
The First line works fine as you provide the proper separators denoting the different cells but when moving inside the loot the resultant command for the statements specified becomes a single sting with no separators thus following code might be helpful. MyExcelFile << "N, Bal, Int,P" << endl; for (int...
There will be a external library for csv. may be you can use jcsv,opencsv, commons csv etc. You have add it to classpath while compiling and running..
php,excel,csv,xls,export-to-csv
utf8_decode and html_entity_decode works for me: <?php set_time_limit(300); require_once 'excel_reader2.php'; $data = new Spreadsheet_Excel_Reader("file.xls", false, 'UTF-8'); $f = fopen('file.csv', 'w'); for($row = 1; $row <= $data->rowcount(); $row++) { $out = ''; for($col = 1; $col <= $data->colcount(); $col++) { $val = $data->val($row,$col); // escape " and \ characters inside the...
The information is already there for you to access you just need to get it. $data | Group-Object SalesID | %{ New-Object pscustomObject -Property @{ SalesID = $_.Name Quantity = ($_.Group.Qty | Measure-Object -Sum).Sum Amount = ($_.Group.Amount | Measure-Object -Sum).Sum } } | Select-Object SalesID,Quantity,Amount | export-csv $outFilePath -encoding "UTF8"...
powershell,export-to-csv,get-eventlog
$errorlog = Get-EventLog system -Newest 200| Where-Object {$_.entryType -eq 'Error'} $verboselog = Get-EventLog system -Newest 200| Where-Object {$_.entryType -eq 'Verbose'} $warninglog = Get-EventLog system -Newest 200| Where-Object {$_.entryType -eq 'Warning'} $errorlog+$verboselog+$warninglog | Export-Csv C:\service\test.CSV I replaced the -match with -eq and dropped the inputobject switch. I also changed the commas...
apache-camel,export-to-csv,bindy
A field with the type int can not be set to null. This is just not possible in Java. Use Integer instead for nbRoom.
vb.net,devexpress,export-to-csv,xtragrid
To get this working, you need the extra line for BindingContext as below: (ForceInitialize is not essential in this context, but in other contexts - within Form Load for example - it is very helpful - so I left it intact) Dim grdGrid As New XtraGrid.GridControl Dim gdvGrid As New...
sql,sql-server,csv,export-to-csv,autosys
I have found a solution for my problem. Credits also go to @Rogala (The developer who gave initial answer to the question) for triggering the idea of using system tables. The code is as below: DECLARE @tableName VARCHAR(Max) = '[Put your table name here]'; DECLARE @currColumns VARCHAR(Max) = NULL; Declare...
You shouldn't use an isinstance check here (and especially not with a class in a private module like _csv): isinstance calls violate OOP in general. More specific to Python, its "duck-typing" means that you should just try and use the method and catch attribute errors: if it quacks like a...
Use unicode symbol 00B1. mysymbol <- "\u00B1" foo <- cbind(test_avg[ , 1:2], paste(as.matrix(round(test_avg[3], 1)), as.matrix(round(test_sd[3], 1)), sep= mysymbol)) > foo cyl gear dev 1 4 3 21.5±NA 2 4 4 26.9±4.8 3 4 5 28.2±3.1 4 6 3 19.8±2.3 5 6 4 19.8±1.6 6 6 5 19.7±NA 7 8 3...
excel,powershell,csv,export-to-csv,powershell-v4.0
I strongly feel your issue is coming from your path concatenation logic. Lets look at the following code from within your loop. $n = $inputWorkbookPath + "_" + $workSheet.Name $workSheet.SaveAs($outputDirectory + $n + ".csv", 6) In your example call your variables I think are mapped as follows: $inputWorkbookPath equals "R:\Unclaimed...
php,csv,php-5.3,export-to-csv,php-5.4
The problem problem lies here: if (isset($_POST['export'])) { $output = fopen('php://output', 'w'); $sFileName = 'Fichier_de_logistique.csv'; header('Content-Disposition: attachement; filename="' . $sFileName . '";'); header('Content-Type: application/download'); fwrite($output, "sep=;\n"); fputcsv($output, array('Nom', 'Prenom'), ";"); foreach ($aFilterGifts as $value) { fputcsv($output, $value, ";"); } fpassthru($output); fclose($output); } return $this->render('template/customer_service/member/logistique.twig'); The function writes...
When dealing with leading zeros you need to be cautious if exporting to excel. Excel has a tendency to outsmart itself and automatically trim leading zeros. You code is fine otherwise and opening the file in any other text editor should show the zeros.
php,mysql,laravel-4,export-to-csv
Finally i solved the issue, thanks to Adrenaxus valuable comments all i did is deleted all the empty lines after closing php tag.Please note that you must do this in all php files in your application. In my case i checked the current file which i was working and failed...
jquery,asp.net-mvc,download,export-to-csv
You should pass the file name to window.location url and do not use a single apostrophe. $('#ui_btn_ExportCsv').click(function (event) { var formContainer = $("#infoForm"); $.ajax({ type: 'GET', url: '/Report/ExportReport', data: formContainer.serialize(), //contentType: 'application/json; charset=utf-8', //dataType: 'json', success: function (returnValue) { window.location = "/Report/Download?file=" + yourFileName; } }); }); I believe you...
sql,sql-server,sql-server-2012,export-to-excel,export-to-csv
Zane answered below, "Sounds like a job for Integration Services!"
Since you've not specified OS or language, here is the PowerShell version. I've ditched my previous attempt to work with Import-CSV because of your non-standard CSV files and switched to raw file processing. Should be significantly faster too. Regex to split CSV is from this question: How to split a...
I changed the code to following and it worked for me. foreach ($product->COLL as $COLL) { foreach ($COLL->PRAT as $PRAT){ if($COLL['attrtype']=="ProductattributeTypeScopeSupply"){ $headerarray[] = $COLL['dictionary_entry']; } }; }; foreach ($product->PRAT as $PRAT) { if($PRAT['attrtype']=="ProductattributeTypeScopeSupply"){ $headerarray[] = $PRAT['dictionary_entry']; } }; //echo "ID,"; $headerarray = array_values(array_unique($headerarray)); foreach ($product->COLL as $COLL) {...
sql-server-2008,export-to-csv,ssms
Got it! Thanks @PeterJ and @srutzky for pointing the error correctly. I was using below code to read the file. FileInputStream fstream = new FileInputStream(this.getProperty("input.file")); br = new BufferedReader(new InputStreamReader(fstream)); To handle UTF coding, I modified the code as below and that worked: FileInputStream fstream = new FileInputStream(this.getProperty("input.file")); br =...
python,python-2.7,export-to-csv
To write the sequences to a file you can use the following: f=open('foo.csv','w') f.write('\n'.join(",".join(seq) for seq in itertools.product("01", repeat=10))) f.close() ...
You can save your list using these commands (given that there are no element names containing a dot) l1 <- list(a = 1, b = list(c = 1, d = 2)) vectorElements <- unlist(l1) vectorPaths <- names(vectorElements) vectorRows <- paste(vectorPaths, vectorElements) write.table(vectorRows, "vectorRows.txt", row.names = FALSE, col.names = FALSE, quote...
powershell,foreach,pipe,export-to-csv
EDIT I'm not sure this fully addresses the issue, as some parts of the code seem weired to me such as $tasks = $folder.GetTasks. However OP title clearly says that the CSV is showing the last element meaning to me that his code mostly works except for the Export-CSV part....
Hope this will help try { File exportDir = new File(myDir + "/text/", filename); if (exportDir .getParentFile().mkdirs()) { exportDir .createNewFile(); FileOutputStream fos = new FileOutputStream(exportDir ); fos.write(outputString.getBytes()); fos.flush(); fos.close(); } } catch (Exception e) { e.printStackTrace(); } ...
ruby-on-rails,rails-activerecord,export-to-csv
You're just generating an array to pass through to the css maker, to make a line from, right? You can build that array however you want. csv << ["Category"] + column_names all.each do |ae| csv << [ae.category && ae.category.name] + ae.attributes.values_at(*column_names) end ...
python,csv,web-scraping,beautifulsoup,export-to-csv
It is not only that your last writerow() is not indented properly (it should be under the loop body). Also, you need to iterate over tr elements (representing each row in the desired table containing the data), get the td elements for each tr found in the loop. I would...
As commented by Dagon,  is the BOM and may be causing problems with the file being read (specially if it is done in CMD on Windows). Remove the BOM from your script file. As for the special characters, you may need to convert them, specially if your source isn't...
When you take a look into to source code at line #38 you will see each() for series.points which are actually rendered points. Try to use series.options.data to export all points from series.
OK, one liners are great and all but if you start having issues it might be time to break it down. This will import it to a variable, then select the two columns that you want and export it to a file with -trimmed tacked on the end of the...
python,csv,web-scraping,beautifulsoup,export-to-csv
You need to open for writing not pass an iterable: with open(csvfile, "w") as csvfile: # w opens for writing If you want to write items from your loop you should open outside and write in the loop: with open(csvfile, "w") as csvfile: link_writer = csv.writer(csvfile) for row in Products:...
php,web-scraping,export-to-csv
I was able to get all of my data into an array using the code provided by Dave. Also, in fopen I was using backslashes "\" , and after switching to forward slashes "/" I was able to produce an error I can work with for exporting to CSV.
php,csv,sql-server-2012,export-to-csv
$out .= implode("\t", array_keys($data)) . "\n"; Is creating a tab separated line, but elsewhere you are using comma separated. Probably you want to use comma's here as well: $out .= implode(",", array_keys($data)) . "\n"; ...
python,csv,scripting,export-to-csv,paraview
I finally managed to get it right. So, the problem with the previous script is though it was moving on to the next time step once the PlotOverLine was complete, it was trying to pick a line within the line. I just tweaked the way the time loop takes place...
java,arraylist,groovy,export-to-csv
If you are iterating with eachRow, each row is a groovy.sql.GroovyResultSet (strictly speaking, a groovy.sql.GroovyResultSetProxy). Since it does not implement Map interface, you cannot use collect, etc. Therefore, there are several options: Get each field by name (the one you want to avoid) sql.eachRow("select field1, field2, field3, etc from student")...
Easy enough, just ignore the fact that they're CSV files, for a For loop based on line count, and join each line with a comma. $CSV1 = Get-Content C:\Path\To\File1.csv $CSV2 = Get-Content C:\Path\To\File2.csv For($i=0;$i -lt $csv1.count;$i++){ $CSV1[$i],$CSV2[$i] -join ','|Out-File C:\Path\to\NewFile.CSV } That should output a file as desired: 1,2,a,b 3,4,c,d...
java,csv,google-analytics-api,export-to-csv
Well where you loop through the columns just add a comma. for(String column : row) { System.out.println(column + ", "); } You might need to modify it as this code adds a comma at the end of each element, including the last one. You would need to find out if...
Here is different options of achieving it. R Code: # Option 1: Using plyr library(plyr) datafiles <-list.files (pattern='*.txt') dataset <- ldply(datafiles, read.table, header=F) # Option 2: Using fread library(data.table) datafiles <-list.files (pattern='*.txt') dataset = rbindlist(lapply( datafiles, fread, header=F)) # Option 3: do.call method dataset <- do.call("rbind",lapply(datafiles, FUN=function(files){read.table(files, header=FALSE)})) # Option...
php,doctrine2,export-to-csv,typo3-flow
I solved the problem with arbitrary DQL. As I mentioned I think the problem was that I didn't got an array as result by the query. But with the following query in my repository I do: /** * @Flow\Inject * @var \Doctrine\Common\Persistence\ObjectManager * inject Doctrine's EntityManager to execute arbitrary DQL...
excel,powershell,table,export-to-csv
I searched the MSDN entry for Excel automation and could not find a way to reference tables by name. Does that mean it's not there and I missed it? No, but it means that it's not obvious, and quite likely means that it is not there at all. Next, can...
ipython-notebook,export-to-csv
Check to make sure the new_links is a list of lists. If so and wr.writerow(new_links) is still not working, you can try: for row in new_links: wr.writerow(row) I would also check the open statement's file path and mode. Check if you can get it to work with 'w'. ...
powershell,dataset,export-to-csv
I think the issue is this line: $adapter.Fill($dataset) Which returns the number of items provided to the method. Try changing it to: [void] $adapter.Fill($dataset) Therefor the caller of Get-DatabaseData receives that number (i.e. 6) + $dataset.Tables[0]...
java,export-to-excel,oracle-adf,export-to-csv
You should post this question to the blog author. There are a large number of blogs on ADF lately and while seeing all these new trend is encouraging, not all the blog posts are following ADF general best practices in terms of code quality or performance tuning.
Without seeing a snip-it of your CSV file, I can't give you an exact answer. I can, however, use a CSV file I made that should look something like your data. You'll have to fill in the gaps wherever they are. I've never dealt with parsing CSV files in Ruby...
vba,import,access-vba,export-to-csv,recordset
EDIT: My first answer of Do..Loop with DCount to wait for the records to be inserted was was incorrect. As it turns out, it was: DBEngine.Idle dbRefreshCache after the TransferText command which did the trick....
c#,sql,sql-server,lambda,export-to-csv
Manage to fix using this : a.ExecuteCommand("update ExporttoExcel set CardNotes = REPLACE(REPLACE(CardNotes, CHAR(13), ' '), CHAR(10), ' ')"); The variable "a" stands for DataContext. Hope for other to help! thanks! :)...
python,mongodb,csv,pymongo,export-to-csv
You need to use csv.DictWriter instead of csv.writer because your query results are dictionaries. You also need to specify your projection fields in your query. Change your query to this. cursor = db.channels.find({},{'_id':0, 'postcode': 1, 'upline': 1, 'cit_state': 1, 'contact_person': 1, 'contact_no': 1,'nominal_level': 1, 'credit': 1, 'level': 1, 'account_holder': 1,...
RDF has a very simple data model: it's just subject predicate object. You can see this by converting your file to n-triples: $ rdfcopy myfile.ttl # apache jena $ rapper -i turtle myfile.ttl # rapper (part of librdf) But this is limited. Suppose you start with the nice looking turtle...
excel,excel-formula,pivot-table,export-to-csv,worksheet-function
My hunch is PivotTables are irrelevant here (and that this is more "one off" than "routine") so suggest: Work on a copy. Parse data assumed to be in ColumnA with Text to Columns and pipe as the delimiter. Insert a row at the top. In C2: =IF(A1=A2,C1&","&B2,A2&","&B2) in D2: =A2<>A3...
mysql,database,csv,export,export-to-csv
Sounds like you need a database. Luckily, 5GB is actually pretty small. Import it into MS Access. No need to spin up a database server yet.
arrays,powershell,export-to-csv,logical-operators
If i understand this correct, you want the values in $msaArray, where $billingList contains customerIDs which are present in $msaClients but their corresponding Accounted time should not be eual to $idzero( 0 in this case) PS C:\> $msaArray = ($billingList | where {(($msaclients -contains $_.customerid)) -and ($_.'accounted time' -ne $idzero)})...
vba,ms-access-2010,export-to-csv
Ah, ok, I figured it out. I thought I had to specify the columns in Schema.ini, but I was mistaken. I just needed to set the header to true; that way it'll read whatever happens to end up in the query. Setting the text delimiter to none was also a...
powershell,scripting,dns,export-to-csv,reverse-dns
Does this help solve your error handling problem? $(ForEach ($IPADDR in $IPADDR) { Try { [System.Net.DNS]::GetHostbyAddress($IPADDR) | Select Hostname,@{label='IP';expression={$IPADDR}} } Catch { Add-Content -Value "$IPADDR failed lookup" -Path "C:\Users\douglasfrancis\Desktop\Script_Results\ReverseLookup_failed.csv" } }) | Sort -Property Hostname | Export-Csv "C:\Users\douglasfrancis\Desktop\Script_Results\ReverseLookup.csv" -NoTypeInformation ...
I would help you with xmllint, but your xml file don't seen to be valid. Anyway here's a quick and dirty solution, which you should probably avoid: grep -Po "(rbs|site)\d+" file.xml | awk '/site/{site=$1} /rbs/{print $1","site}' rbs008811,site00881 rbs008819,site00881 rbs008821,site00882 rbs008829,site00882 rbs008831,site00883 rbs008841,site00884 rbs008849,site00884 ...
apache,csv,cassandra,export,export-to-csv
The syntax of your original COPY command is also fine. The problem is with your column named timestamp, which is a data type and is a reserved word in this context. For this reason you need to escape your column name as follows: COPY product (uid, productcount, term, "timestamp") TO...
Convert the variable into a string before exporting it.
php,csv,utf-8,export-to-csv,byte-order-mark
From my experience I tell you that the first empty line is because of some forgotten space/empty line outside php tags. To obtain the desired empty line after \xEF line try this: $output = fopen('php://output', 'w'); $BOM = "\xEF\xBB\xBF "; $fwrite($output,$BOM) Also, if there are included files in your php...
I think when you first read model->rowCount() the model has not fetched all the results completely. Although it will fetch more later when table view is displayed resulting in a full display of rows in the table view. Try to use QSqlQueryModel::fetchMore before reading the row count : while (model->canFetchMore())...
list,csv,python-3.x,export-to-csv
Your string is a single string. It is not a list of strings. You are expecting it to be a list of strings when you are doing this: for row in string: When you iterate over a string, you are iterating over its characters. Which is why you are seeing...
save this in a file, e.g. makecsv.rc: #!/bin/sh echo Type,Count,Name x=0 for f in `cat` do x=`expr $x + 1` echo Def,u$x,$f done then run as: cat ../test.txt | ./makecsv.rc > ../test.csv if needed, you do chmod +x makecsv.rc The advantage is that the input/output file names are not hardcoded...
file_out.writerow([line]) will create a list with only one element for example In [1]: test = "1,2,3,4,5,6,7" In [2]: list_test = [test] Out[2]: ['1,2,3,4,5,6,7'] In [6]: len(list_test) Out[6]: 1 what you need is a list of the delimiter separated elements. Use the list after line.split(",") in your code would return such...
java,csv,filestream,export-to-csv,opencsv
You already have a string array of the values in String[] values. So why not assign back the modified balance to values[11] and then join the values, glued with a semicolon? You can try adding this after System.out.println(balance);: System.out.println(balance); // replace original value with the modified balance values[11] = String.valueOf(balance);...
python,python-2.7,csv,dictionary,export-to-csv
Since you have a bunch of dictionaries, it might be a little simpler to use csv.DictWriter, which will automatically align the keys. Something like with open("output.csv", "wb") as f: writer = csv.DictWriter(f, fieldnames=list(events[0]), delimiter = ';') writer.writeheader() for event in events: outevent = event.copy() outevent["random_nums"] = ", ".join(map(str, outevent["random_nums"])) outevent["guests"]...
python,numpy,ocaml,export-to-csv,hdf5
First of all I would like to mention, that there're actually bindings for HDF-5 for OCaml. But, when I was faced with the same problem I didn't find one that suits my purposes and is mature enough. So I wouldn't suggest you to use it, but who knows, maybe today...
It's up to you to (programatically) define the header, and which columns are written - Super CSV doesn't just automatically marshal an object to CSV for you (like Jackson does for JSON). You should check out the documentation on the website - in particular the section on partial writing....
You need to first add SKU column in order grid and then you can use export CSV to get that column in exported file. To add SKU column, follow below article. http://www.atwix.com/magento/adding-sku-column-to-orders-grid/...
tags,extract,stack-overflow,export-to-csv,text-extraction
Run appropriate query on data.stackexchange.com and click on "Download CSV" link. Also you can download a complete DB dump (the link is on the DB.stackexchange help page)...
Another solution - a bit tedious, Use Import Text File in Excel, click thru the dialog boxes and in Step 3 of 3 of the Text Import Wizard, you will have an option of setting the column data format, use "Text" for the column that has "2-60", "2-61", "2-62", "2-63"....