[정보] Excel CSV - Number cell format

2013.07.10 23:40

Taedong Yun 조회 수:11145

http://stackoverflow.com/questions/137359/excel-csv-number-cell-format


I produce a report as an CSV file. When I try to open the file in Excel, it makes an assumption about the data type based on the contents of the cell, and reformats it accordingly.

For example, if the CSV file contains

...,005,...

Then Excel shows it as 5. Is there a way to override this and display 005?

I would prefer to do something to the file itself, so that the user could just double-click on the CSV file to open it.

I use Excel 2003.

share|improve this question

There isn’t an easy way to control the formatting Excel applies when opening a .csv file. However listed below are three approaches that might help.

My preference is the first option.

Option 1 – Change the data in the file

You could change the data in the .csv file as follows ...,=”005”,... This will be displayed in Excel as ...,005,...

Excel will have kept the data as a formula, but copying the column and using paste special values will get rid of the formula but retain the formatting

Option 2 – Format the data

If it is simply a format issue and all your data in that column has a three digits length. Then open the data in Excel and then format the column containing the data with this custom format 000

Option 3 – Change the file extension to .dif (Data interchange format)

Change the file extension and use the file import wizard to control the formats. Files with a .dif extension are automatically opened by Excel when double clicked on.

Step by step:

  • Change the file extension from .csv to .dif
  • Double click on the file to open it in Excel.
  • The 'File Import Wizard' will be launched.
  • Set the 'File type' to 'Delimited' and click on the 'Next' button.
  • Under Delimiters, tick 'Comma' and click on the 'Next' button.
  • Click on each column of your data that is displayed and select a 'Column data format'. The column with the value '005' should be formatted as 'Text'.
  • Click on the finish button, the file will be opened by Excel with the formats that you have specified.

댓글 0

목록
번호 제목 글쓴이 날짜 조회 수
공지 [정보] Noteworthy Composer(NWC) 사용법 & 팁 Taedong Yun 2012.05.07 120145
공지 [정보] 이메일 설정 Taedong Yun 2011.07.09 46727
공지 [정보] 중요 리눅스 커맨드 (계속 업데이트) Taedong Yun 2010.05.01 96678
공지 [자료] 시외버스 & 5005번 시간표 Taedong Yun 2005.03.11 60843
공지 [자료] Token Taedong Yun 2005.03.24 56763
공지 이름 대신 뜨는 이미지박스 신청 요령~ Taedong Yun 2004.02.25 55501
공지 - 의문사항 노트 Taedong Yun 2007.09.21 62857
공지 - 관심이 가는 책들 Taedong Yun 2005.01.15 54793
53 [자료] Solutions of "Algebraic Geometry" (Hartshorne) Ch.1 file 윤태동 2008.05.06 8546
52 [정보] 2008 Fall Courses & Textbooks - MIT Mathematics 윤태동 2008.06.19 11135
51 [자료] 2008 Fall Timetable file 윤태동 2008.09.03 6192
50 [자료] Beantown Jazz Festival 정보 file 윤태동 2008.09.27 6047
49 [자료] Mumford Red Book 윤태동 2008.10.02 6144
48 [자료] SCI Math Journal List file 윤태동 2008.10.18 22498
47 [정보] 보호된(secured) PDF 파일 해제하기 윤태동 2008.11.30 21774
46 [자료] 2009 Spring Timetable file Taedong Yun 2009.02.03 6021
45 [영상] 핑클 - 영원 [1] Taedong Yun 2009.04.25 6958
44 [유머] Anagram - Taedong Yun Taedong Yun 2009.04.29 11156
43 [영상] 카라 - 길 (MBC 음악여행 라라라) Taedong Yun 2009.10.23 6511
42 [정보] Windows 7 키보드 단축키 Taedong Yun 2009.11.05 7120
41 [정보] Outlook 2007 에서 MIT Combinatorics Seminar 인터넷 일정 구독 방법 Taedong Yun 2010.02.04 8645
40 [정보] Google Calendar Sync to iPod touch Taedong Yun 2010.02.12 87300
39 [정보] 2010 Fall Courses Taedong Yun 2010.05.18 6428
38 [정보] 노트북 사용 까페 (한국) Taedong Yun 2010.06.01 6396
37 [정보] XE (제로보드) 1.1.5에서 최신버전으로 업데이트 방법 Taedong Yun 2010.08.31 8056
36 [정보] BSO 공연 스케줄 2010 Fall Taedong Yun 2010.09.13 6589
35 [info] 2011 Conferences Taedong Yun 2010.10.21 7695