CSV Files and Formatting to open in Excel - excel

I have a CSV file but unfortunately, for some of the columns which have a comma in them, they have not enclosed it within double quotes, so when I open the CSV file some rows are all off by one column.
Is there a way that I can identify these rows and format them correctly so that I can open them. I am happy with a non-coding solution or even a coding solution.
Note: The column width cannot be used as they are all varying column width and no way to identify them distinctly.
Any help is appreciated!
Screenshot #1:
This is the CSV file. As you can see, the second row has a comma but doesn't have any double quotes around it. As a result, when I open this file in Excel, the following happens.
Screenshot #2:
So, the question is - How can I modify the file and then open it so that the right data is under the right column as shown below.
Screenshot #3: Desired Output

Related

plotting data from a txt file with excel

I have a text file that I will upload it. I wanna to select just 2 columns and then plot it with something like excel!
the problem is that when i want to select a column, those things that selected, is not just one column. I try it to open with excel. however it opened but there was same problem again. I'm just wanna select all data of one column and then plot it.
I can not even copy or a paste a certain data. all data will copy instead.
My English is not adequate, I know. Hope to could convey my mean.
Any help will be appreciated.
file
In excel, select the first column which should contain all the columns from your text file.
In the excel menus (or using the search field), select « convert ». Then chose the type « delimiter », and select the delimiter in your excel file. Either a comma, or a tabulation, etc.
Click ok and this should do the trick

CSV file, not keeping leading zeros, what do do

I have no idea what to do. Please see below. I need to import this file into another system with the leading zeros. These are sample zip codes as well. I have no idea what is going on. It seems to be an excel issue with CSV files. How can I preseve the leading zeros on a CSV file? Thanks for your help. I haven't had this issue before.
XLSX File
POSTAL_CODE_FORMATTED_TEXT and POSTAL_CODE_FORMATTED_Number
07717
Please see CSV file
CSV File
POSTAL_CODE_FORMATTED_TEXT and POSTAL_CODE_FORMATTED_Number
7717
If you would like the edit the column manually you can follow the below steps
Highlight the column
Right click and select format cells
On the "Number" tab go to "Custom"
4: Under where it says "Type:" you can enter the amount of digits you want to appear in the column (ex: 00000)

Excel pasting data issue

Hi all i have been conducting research using JNNS creating neural networks.
I have collected my results inside a result file and wish to create graphs with them to clearly present my findings in a report.
My issue is when pasting the result file contents (expected outputs and then actual outputs) into excel the whole set of results goes into the A1 column instead of spreading across multiple rows
Does anyone know how i would go about fixing this issue?
Example to aid question:
1.1 Expected result / actual result
0, 0, 1, 0
0.02501, 0.00013, 0.99952, 0
and pasting this into excel does this:
https://gyazo.com/38c089ebcfaca7b85d31caacd3e950f9
instead of this:
https://gyazo.com/22f1527df18e811871e53402cea4ab2f
Thanks
I am guessing your data is in a CSV format, do you have notepad++?
if you do open it there and click on the show all characters, i wanna know what do you have at the end of your lines CR or LF...
Thanks to OmarQA for the help, i needed to paste my data into a text file, replace all spaces with commas using the replace tool, then import data from text on excel and use comma as data separation and it solved the issue!
Thanks
It might be that excel's not recognizing the proper delimiter when you're pasting you data. On Excel, select the cell with the entire text (in your picture, cell A1) and go to the Data tab. Look for a button called "Convert text to columns" or something like that. It will open a new window asking you for parameters (delimiters, if comma is a decimal separator, etc) and it gives you a preview of how your data is going to look like with that setting. Just mess around a little bit and you should get your data good to go. Looking at your picture, it might be possible that you didn't select "tab" as a delimiter.

Excel - exporting as TXT with text position

I have several text files (about 6). All have the following format.
Column (Text position in txt file)
1-4 -> Code
6-72 -> Name
74-78 -> another code
80-81 -> another code
These text files I want to import into excel, so I can sort them after A-Z and inspect the duplicates. After doing so, I must delete a few duplicates and export this to ONE single txt file. This file must be saved in the exact same format as before. Unfortunately I cannot find anything in the Internet regarding this.
Could somebody help me?
Thanks and best regards
Dennis
I found a solution!
First I combine the data in the excel file and manipulate it. After
that I adjust the width of the columns, so no values overlap.
Then I save this as an .prn file.
This .prn file I open in notepad++ and manipulate the column
position with help of SHIFT + ALT + Down to set multiple Cursors.
Now I got my file :-)
Thanks anyway!
Ressources:
Export an Excel Spreadsheet as fixed width text file
Notepad Multiple Cursors

pentaho report excel output - leading '0' gets truncated

I have a format issue with my pentaho report excel/csv output.
My report output contains zip code column, which has leading zeroes if the zip code length is less than 5. the leading zeroes get truncated when i open the report output in excel file. I used 'textfield' for the zipcode column, i even tried concatenating zeroes in my xaction sql. everything works fine if i open the output in a text editor, but when we open it in excel file the zero got trimmed.
can we prevent this trimming issue or can we use other data fields in design instead of text field.
Change the extension of your csv to .txt so you get Excel's dialogue boxes for importing text files; there you can select the comma as your column delimiter. On the third screen (after you hit "next" twice), there is an option to choose the formatting of each column. Select you zip code column, change it from "General" to "Text" format, and your leading zeroes will be retained.
use text formatting in the Home-->Number-->Special
Cannt paste imapge--> i guess not enough points
Hope it helps
I don't know whether it is proper or not but enclose field in Double quotes or single which ever you prefer..
quotes will not display in excel file format but it will display in textpad or notepad..
So it you don't have any problem in adding this extra thing then it will solve your problem.
What is the original data format in your DB? Is it an INT?
In your sql statement, try something like this (adjust for the relevant sql dialect, if necessary):
lpad(cast(zip as CHAR(5)),5,'0') zip
where zip is your field name.
Then use text-field as you are already doing.

Resources