Subscribe to How-To Geek Mag-subscribe sa Paano-Upang Geek

Important! This is an automatic machine translated page. If you can read english, you should Click Here to read the original English version of the article.

How To Import a CSV File Containing a Column With a Leading 0 Into Excel Paano Upang I-import ang isang CSV file Naglalaman ng isang Haligi Sa isang nangungunang 0 Sa Excel

Microsoft Excel will automatically convert data columns into the format that it thinks is best when opening comma-separated data files. Microsoft Excel ay awtomatikong pag-convert ng mga haligi ng data sa ang format na ito ay thinks pinakamahusay na kapag binubuksan comma-separated file ng data. For those of us that don't want our data changed, we can change that behavior. Para sa mga ng sa amin na hindi gusto ng aming data ay nagbago, maaari naming baguhin na ang pag-uugali.

You have a CSV file probably exported from other application or given to you by other people. Mayroon kang isang CSV file malamang na nai-export mula sa ibang mga aplikasyon o ibinigay sa iyo sa pamamagitan ng ibang tao. You would like to open it up in Excel since you know it very well. Gusto mo bang buksan ito hanggang sa Excel dahil alam mo ito tunay mabuti. The CSV file will look like this (if you open the file in notepad.exe): Ang CSV file ay ganito ang hitsura (kung buksan mo ang file sa notepad.exe):

The file contains columns: ProductModelID, Name, SpecialID, and ModifiedDate. Ang file ay naglalaman ng mga haligi: ProductModelID, Pangalan, SpecialID, at ModifiedDate. The column SpeicalID containing data with leading 0 and it is specialized code so you would like to keep the leading 0s in Excel. Ang haligi ng SpeicalID na naglalaman ng data sa mga nangungunang 0 at ito ay espesyal na code kaya nais mong panatilihin ang mga nangungunang 0s sa Excel. Since it is a CSV file it is, by default, shown in your Windows Explorer as an Excel file: Dahil ito ay isang CSV file na ito ay, sa pamamagitan ng default, ang mga ipinapakita sa iyong Windows Explorer bilang isang Excel file:

So you double-click the file and open the file in Excel as such: Kaya mo i-double click ang file at buksan ang file sa Excel na tulad ng:

You can see that by default, Excel stripped out the leading 0s in column 3 “SpecialID €?. Makikita mo na sa pamamagitan ng default, ang Excel Nakuha ang nangungunang 0s sa haligi ng 3 "SpecialID €?. You brought up Excel application and tried to use File/Open to open the file manually and that doesn't work either. Ikaw ay nagdala ng Excel up ng application at tried sa paggamit ng File / Buksan upang buksan ang file na mano-mano at hindi gumagana ang alinman. How can I fix this? Paano ko maayos ito?

The trick is to rename the file with .TXT extension then bring the file into Excel. Lansihin ay upang pangalanang muli ang mga file na may. TXT extension pagkatapos ay dalhin ang mga file sa Excel. SO first bring up “My Computer €? SO unang magdala up "My Computer €? and navigate the folder to where the file resides. at pumunta sa folder kung saan ang file sa tirahan.

Now, if you don't see the file extension .CSV (Windows has this option disabled by default) then follow this step to enable the file extension – Select the menu “Tools €?/ €?Folder Options €? Ngayon, kung hindi mo makita ang file extension. CSV (Windows ay ang opsyon na ito pinigilan sa pamamagitan ng default) pagkatapos ay sundin ang hakbang na ito upang bigyan ng kakayahan ang file extension - Piliin ang menu ng "Tools €? / €? Folder Options €? then select the “View €? pagkatapos ay piliin ang "View €? tab, uncheck the item “Hide extensions for known file types €? tab, alisin ang tsek ang aytem na "Itago ang palugit para sa mga kilalang uri ng file €? as the picture below: bilang ng mga larawan sa ibaba:

Then you should see the file extension as such: At dapat mong makita ang file extension bilang tulad ng:

Right click the file and select rename to rename the file to become “ProductInfo.txt €? Right click ang file at piliin ang palitan ng pangalan upang pangalanang muli ang file na maging "ProductInfo.txt €?

Notice the icon changes to regular text file icon as well. Paunawa ang icon ng mga pagbabago sa mga regular na icon ng text file na rin. No open up Excel and use “File €?/ €?Open €? Walang bukas hanggang Excel at gamitin ang "File €? / €? Buksan €? command to bring the file into Excel. utos na magdala ng file sa Excel. When you do this, a dialog will pop up like: Kapag ginawa mo ito, ang dialog ay isang pop up tulad ng:

Make sure the “Delimited €? Siguraduhin na ang "Delimited €? radio button is selected and click on “Next €? radio button ay pinili at i-click sa "Next €? button to continue. na pindutan upang magpatuloy. On the next screen, check the box “Comma €? Sa susunod na screen, i-tsek ang kahon ng "Comma €? and uncheck all other selections. at tsek ang lahat ng iba pang mga pinili.

Click on “Next €? Mag-click sa "Next €? to advance to the next screen. upang isulong sa susunod na screen. In this screen, you need to click on the “SpecialID €? Sa screen na ito, kailangan mong i-click ang "SpecialID €? column and select the “Text €? ang haligi at piliin ang "Text €? radiobutton from the “Column data format €? radiobutton mula sa "Haligi ng data € format? section. seksyon.

Click on “Finish €? I-click ang "Tapos €? then you are done. pagkatapos kayo ay tapos na.

You can see now the column “SpecialID €? Makikita mo na ngayon ang haligi ng "SpecialID €? has been brought in as a Text column and all leading 0 are preserved. ay dinala sa bilang isang haligi ng Text at ang lahat ng mga nangungunang 0 ay pananatilihin.

This method can be applied to any special circumstance for bringing in a CSV file into Excel including other delimited files. Ang pamamaraan na ito ay inilalapat sa anumang espesyal na bagay-bagay para sa mga nagdadala sa isang CSV file sa Excel kasama ang iba pang mga delimited file. With the ability of specifying the data type for each column during the data importing process you are in much better control on your final result. Gamit sa kakayahan ng tumutukoy sa uri ng data para sa bawat haligi sa panahon ng pag-import ng data ng proseso ng ikaw ay nasa magkano ang mas mahusay na kontrol sa iyong huling resulta.

This article was originally written on 04/20/07 Tagged with: Ang artikulong ito ay orihinal na isinulat sa 04/20/07 Tagged with: Microsoft Excel Microsoft Excel , , Microsoft Office Microsoft Office

Daily Email Updates Araw-araw na Updates Email

You can get our how-to articles in your inbox each day for free. Maaari kang makakuha ng aming kung-paano na mga artikulo sa iyong inbox sa bawat araw para sa libre. Just enter your name and email below: Ilagay lamang ang inyong pangalan at email sa ibaba:


Name: Pangalan:
Email: Email:

Comments (10) Comments (10)

  1. Mikey Mac Mikey Mac

    Another way to do this – especially if the column is of a fixed umber of chars like “SpecialID” above – you simply highlight the column or cells you want to fix, right-click, Format Cells…, click Custom on the Number tab, and type four zeros (or however many chars the field should be) and click OK. Ang isa pang paraan upang gawin ito - lalo na kung ang mga haligi ay sa isang nakapirming madilim na kayumanggi ng mga karakter tulad ng "SpecialID" sa itaas - mo lang i-highlight ang mga haligi ng mga cell o gusto mong ayusin, i-right click, Format ng cell ..., i-click ang Custom sa tab na Number, at sa apat na uri ng mga zero (o gayunpaman maraming karakter sa patlang ay dapat) at i-click ang OK. Excel will automatically pad the field with leading zeros. Excel ay awtomatikong pad sa patlang na may mga nangungunang mga zero.

    The bonus to this method is that you can still do calculations with the number without having to use complex formulas to convert the text “number” into a real number. Ang bonus na ito ay paraan na maaari ka pa rin sa kalkulasyon ang bilang nang hindi na kinakailangang gumamit ng kumplikadong formula upang i-convert ang teksto "bilang" sa isang tunay na numero.

  2. Jim Millard Jim Millard

    A third alternative, assuming you have control over the creation of the CSV, is to export the “SpecialID” field as a formula, eg, instead of exporting (0001), export (=”0001″). Ang pangatlong alternatibo, ipagpapalagay na nakatanggap ang may kontrol sa paglikha ng CSV, ay upang i-export ang "SpecialID" field bilang isang formula, halimbawa, sa halip na i-export (0001), i-export (= "0001"). That forces the value to be evaluated as text, as Excel evaluates the field as a text formula. Pwersa na ang halaga ay sinusuri bilang teksto, tulad ng Excel sinusuri ang patlang na bilang isang formula na teksto.

  3. Erin T Erin T

    Thank you! Salamat! I was really struggling with this and appreciate the easy to follow instructions. Talagang ako ay struggling sa mga ito at pinasasalamatan ang madaling sundin ang mga tagubilin. My problem is solved! Aking mga problema ay lutasin!

  4. Paul F Paul F

    Thanks much. Thanks much. This page helped me a lot — exactly the info I was looking for. Ang pahinang ito ay nakatulong sa akin ng isang pulutong - ang eksaktong impormasyon ng ako ay naghahanap.

  5. Prathap Prathap

    Thanks all. Salamat sa lahat. This helped to solve my problem. Na ito ay tumulong sa paglutas ng aking problema.

  6. andrew marshall Andrew Marshall

    when importing part number from a csv file some number cotaining E kapag-import ng mga bahagi numero mula sa isang csv file na ang ilang mga numero cotaining E
    eg 977012e000 when importing into excel 2007 the number end up looking like 9770+e can you please advise me how to fix this as every part number containing e is treated the same way. hal 977012e000 kapag ini-import sa excel 2,007 ang bilang ng dulo up naghahanap ng tulad ng 9770 + e maaari ninyo bang ipaalam sa akin kung paano ayusin ito bilang bahagi ng bawat numero na naglalaman ng e ay ginagamot sa parehong paraan.

  7. Anon Anon

    Thanks Salamat

  8. Vivek Vivek

    Jim's option worked for me. Jim's opsyon na nagtrabaho para sa akin. No need to manipulate the file later. Hindi na kailangan upang mamanipula ang file na mamaya.

    Thanks Salamat

  9. husker husker

    Jim's option is really simple when compared to other solutions out there and worked… thanks Jim's option ay talagang simple kapag kumpara sa iba pang mga solusyon lumitaw diyan at nagtrabaho ... thanks

  10. tapas tapas

    i still can't solve my problem, ako hindi pa rin malutas ang aking mga problema,
    its same katulad nito
    can,t open my .csv excel files in office 2007. maaari, t buksan ang aking. excel csv file sa opisina ng 2007.


Leave a Comment Iwanan ng isang Puna




Leave your Iwanan ang iyong mga friendly friendly comment here. puna dito.

If you have a computer help question, Kung ikaw ay may isang computer ng tulong tanong, click here to leave it on the forums i-click dito upang mag-iwan ito sa forums instead. sa halip ng.

Note: Your comment may not show up immediately on the site. Tandaan: Ang iyong puna ay maaaring hindi magpapakita agad sa site.

Our Friends Ang aming mga Friends
Getting Started Pagsisimula


About How-To Geek Tungkol sa Paano-Upang Geek
What Is That Process? Ano ba ang Proseso Iyon?
svchost.exe svchost.exe
jusched.exe jusched.exe
dwm.exe dwm.exe
ctfmon.exe ctfmon.exe
wmpnetwk.exe wmpnetwk.exe
wmpnscfg.exe wmpnscfg.exe
rundll32.exe rundll32.exe
wfcrun32.exe wfcrun32.exe
Ipoint.exe Ipoint.exe
Itype.exe Itype.exe
Wfica32.exe Wfica32.exe
Mobsync.exe Mobsync.exe
conhost.exe conhost.exe
Dpupdchk.exe Dpupdchk.exe Adobe_Updater.exe Adobe_Updater.exe

Copyright © 2006-2009 HowToGeek.com. Copyright © 2006-2009 HowToGeek.com. All Rights Reserved. All Rights Reserved.