Not able to convert Excel file to CSV - excel

I have an Excel file with 2 sheets. One with my data with headers and the other is for references. It's basically a template where I am using Sheet 2 for reference values. When I save the file to CSV, it saves all garbage data which I think are due to 2 work sheets and the references between them.
Please find the attached excel sheet and let me know how I can do a proper conversion?
Notes:
I am using Office 2010 Standard
I have tried copying and pasting with "Values" option.
I have tried copying and pasting with "Merge Destination Formatting"
Nothing worked.

I was able to find the solution.
When you copy the selected range of records and paste them to New excel file, just drag the cursor some columns ahead. Remove the newly added columns (Not sure from where they come). Now do a Save As CSV. Thats it.

Related

How can I edit the text of Excel table column headers that are the same across all sheets in the workbook?

I have an Excel workbook that has ~100 sheets in it, and each sheet is a table whose headers are exactly the same. I have edited the text of the headers in my blank "to copy" sheet, but I now need to copy those changes across each and every existing sheet (the rest of which have data in them that I cannot lose/change).
I have already tried using Shift+click to select all the sheets, but cannot edit the header because they are already formatted as tables and I get the "Cannot make changes to a table or XML mapping when multiple sheets are selected." error. So I either need a way to select every sheet and make them not a table anymore (temporarily) so that I can make the bulk change, or find some other way of doing this change while they are still a table.
Thanks for your time and advice.
Mirror a single table to multiple sheets in excel using vba
You might see this solution, As it is not possible to change multiple sheets while they are formatted as tables .. you might do the changes if your sheets are not formatted as sml or tables.

DataGrip Copy Table Values to Excel Error

I am using DataGrip 2020.1.5 and trying to Copy and Paste certain table values from my table (DB is Oracle) to an Excel file.
The portion of values I want to copy is highlighted below.
Values are pasted in a strange format on the Excel; different rows, but all on one column
Paste Format is selected as Tab-seperated (TSV) and I tried to change the settings by Paste Format > Configure CSV Formats... by changing value seperator, but it made no difference.
Column names are also pasted even if I have not ticked the First row is header.
I also tried this copying on both MS Excel 2010 and 2016 still the same output.
I checked about this on the web, also Jetbrains documentation but didn't find anything useful. Perhaps I am missing something here.
Any help would be appreciated, Thanks!
First, what you are trying to do is to copy values to the clipboard and then paste them to Excel. DataGrip has nothing to do with how Excel pastes values, but DataGrip can copy them in the needed way.
I assume you need TSV format for your data in the clipboard. So you need to copy your values in TSV. To do so, please choose the corresponding extractor in the drop-down:
The option you tick, Paste format, has nothing to do with Excel or any other third party application. It defines in what format you have values when you are pasting into the DataGrip's spreadsheet.

How to not get an error when pasting data into a sheet with formulas already in it?

I need a little help understanding how I can simply cut and paste data (multiple cells without formulas) from a CSV doc into a xls template without causing errors on the formulas already in the xls sheet.
to put it another way, When I paste the raw data (no formulas in this data) into the xl sheet template, I have to rebuild the formulas in the template sheet to get them to work.
Any help would be appreciated.
Cheers
Glenn
Redesign your spreadsheet so that the formulas are outside of the pasted range. If you paste into a range of cells, existing content, be it values or formulas, will be overwritten, even if the CSV contains blank cell content. That's how it works.

OpenXML Excel file corruption, DataValidations

I am creating an excel file using OpenXML SDK 2.0 from a WPF application. The excel file has multiple sheets, data validations for dropdown cells, Formulas, and StyleSheets applied. It works fine creating excel rows of around 17,500 in Sheet1 and 17,500 in Sheet2 as well. However, when the number of rows reaches 25,000 for both Sheet1 and Sheet2 the file gets corrupted i.e. while opening the file it gives an error "We found a problem with the content in file.xlsx. Do you want to recover as much as we can?" If I recover the file the data is still there for all 25,000 rows in both the sheets however the datavalidations i.e. dropdowns are not applied for any of the cells. The recovery log is as follows, while the repair message in the screenshot.
error946360_01.xmlErrors were detected in file 'D:\file.xlsx'Removed Feature: Data validation from /xl/worksheets/sheet.xml partRepaired Records: Cell information from /xl/worksheets/sheet.xml partRepaired Records: Cell information from /xl/worksheets/sheet2.xml part
For me, checking if a row is already existing before adding it did the trick.
Somehow, in the xml schema of the xlsx file (for me it was the sheet1.xml), rows were already existing. After running my code, I added a row with an index, which was already existing.
So try to open your excel with winrar, find sheet1.xml (and sheet2.xml in your case) and see if you have duplicated index for rows.
Generate the excel file with your code and don't open it with excel, otherwise excel will remove the duplicates and you won't see the problem.
Another option would be to validate your excel file (before opening) with the Open Xml SDK 2.5 Productivity Tool

Excel Save CSV without blanks

I have an Excel spreadsheet that generates CSV scripts used in an application. The scripts must be in a very specific format, and I save a master in XLSX format with protected sheets and data validation to save the CSVs from rather than directly edit the CSVs, as directly editing the CSVs can lead to mistakes.
The issue is that the scripts can be of nearly any length. The left column of each line can only be one of a certain set of values, and the last line has to say "END". The only way I can do this without VBA is the following formula in the A column, from row 7 (the first 6 are header information) to row 1048576 (last Excel row) and protect the sheet with column A locked:
=IF(AND(ISBLANK(B368),NOT(ISBLANK(B367))),"END",IF(ISBLANK(B368),"",A367))
This makes the last row say "END" in column A, and all rows after blank, which is what is desired. The problem is that now when the CSV file is saved, it will always have 1048576 rows, with all the bottom rows containing the delimiters ",,,," . This won't work, the CSV file needs to stop after the "END" row. Is there a way to write the formula that will cause Excel to ignore the cells which evaluate to blank when saving to CSV or an alternate way to save to CSV in Excel that will ignore all the rows that evaluate to blank?
Note: I have a solution in VBA already that I can use on my own machine (it copies the data up to "END", pastes in a new sheet in text only format, then saves as CSV with the name of the original worksheet). I want to share this sheet, however, and getting around the security constraints to share macros at my company is a pain. So I'm looking for a way this might be done without Macros, if it's possible at all.
In looking for an answer I found this link, which is similar, but not the same:
Saving Excel data as csv with VBA - removing blank rows at end of file to save
As the "blanks" I have are active rows because they contain formulas, this method will not work.
Manually deleting the rows / columns will work to reset the size, as GSerg noted in the other question. Alternatively, also as suggested by GSserg, you can copy the data to a new sheet before saving.
Otherwise, an easy fix might be to create a small post-excel / pre-processing script - perhaps using a batch file - Batch / Find And Edit Lines in TXT file - or a similar solution in any small scripting language to remove the extra rows.

Resources