[정보] Excel CSV - Number cell format

2013.07.10 23:40

Taedong Yun 조회 수:11500

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 125423
공지 [정보] 이메일 설정 Taedong Yun 2011.07.09 47527
공지 [정보] 중요 리눅스 커맨드 (계속 업데이트) Taedong Yun 2010.05.01 102159
공지 [자료] 시외버스 & 5005번 시간표 Taedong Yun 2005.03.11 61372
공지 [자료] Token Taedong Yun 2005.03.24 59409
공지 이름 대신 뜨는 이미지박스 신청 요령~ Taedong Yun 2004.02.25 56036
공지 - 의문사항 노트 Taedong Yun 2007.09.21 63410
공지 - 관심이 가는 책들 Taedong Yun 2005.01.15 56137
434 [개인] TOEIC 결과 secret 윤태동 2005.03.20 5
433 나에게 secret 윤태동 2004.03.10 6
432 수학과 03 주소록 [3] secret 윤태동 2004.03.18 54
431 [정보] CSS 색상표 Taedong Yun 2015.09.26 779
430 [기사] 남자는 여자때문에 일찍 죽어(?) 윤태동 2004.07.21 6030
429 [펌글] 아무리 봐도 이거 진짜 잘맞는다...ㅋ 윤태동 2004.08.05 6046
428 ㅋㅋ3월도 끝나간다.. [13] 이은정 2004.03.21 6052
427 서머세션 해야할 일 윤태동 2004.03.05 6063
426 프렌즈 끝났다.. 윤태동 2004.05.09 6067
425 개념있는 부자가 됩시다 윤태동 2005.02.05 6076
424 그러고 보니 [3] 윤태동 2004.05.05 6077
423 제발 개념을 좀 가졌으면.. 윤태동 2005.01.18 6082
422 탄핵안 가결과 법적 절차. 윤태동 2004.03.12 6089
421 정보처리기사 [1] 윤태동 2005.01.17 6089
420 설 연휴 TV 영화 가이드 file 윤태동 2005.02.08 6090
419 MSK 합격! [3] 윤태동 2004.03.18 6092
418 게시판 통합~ 윤태동 2004.06.29 6093
417 [자료] 2009 Spring Timetable file Taedong Yun 2009.02.03 6093
416 [경험] 허헉; 천재 거지? 윤태동 2004.08.09 6094
415 [영상] 소니의 하이퍼드래깅(멋짐) 윤태동 2005.04.04 6095