How To Import a CSV File Containing a Column With a Leading 0 Into Excel Kako Uvoz CSV datoteke vsebujejo stolpec Z Glavno 0 Into Excel
Microsoft Excel will automatically convert data columns into the format that it thinks is best when opening comma-separated data files. Microsoft Excel bo samodejno pretvori stolpce s podatki v formatu, da misli, da je najbolje, ko odprete z vejico ločene podatkovne datoteke. For those of us that don't want our data changed, we can change that behavior. Za tiste od nas, ki ne želijo naši podatki spremenili, lahko spremenite to vedenje.
You have a CSV file probably exported from other application or given to you by other people. Imate CSV datoteko verjetno izvažajo iz druge aplikacije ali ki vam ga drugi ljudje. You would like to open it up in Excel since you know it very well. Želeli bi, da ga odprete v Excelu, saj veste, da je zelo dobro. The CSV file will look like this (if you open the file in notepad.exe): Datoteka CSV bo videti takole (če odprete datoteko v notepad.exe):

The file contains columns: ProductModelID, Name, SpecialID, and ModifiedDate. Datoteka vsebuje stolpce: ProductModelID, Name, SpecialID, in 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. Stolpec SpeicalID, ki vsebujejo podatke z vodilnimi 0 in je specializirano kodo, da bi želeli obdržati vodilno 0. v Excelu. Since it is a CSV file it is, by default, shown in your Windows Explorer as an Excel file: Ker je CSV datoteka je, privzeto, prikazane v vaš okno raziskovalec kot datoteko Excel:

So you double-click the file and open the file in Excel as such: Torej dvokliknete datoteko in odprite datoteko v Excelu kot tak:

You can see that by default, Excel stripped out the leading 0s in column 3 “SpecialID €?. Vidite lahko, da je privzeto, Excel izloča iz vodilne 0. v stolpcu 3 "SpecialID €?. You brought up Excel application and tried to use File/Open to open the file manually and that doesn't work either. Ti dvignejo Excel uporabe in preizkušen za uporabo Datoteka / Odpri, da odprete datoteko ročno in da ne dela niti. How can I fix this? Kako lahko to popravimo?
The trick is to rename the file with .TXT extension then bring the file into Excel. Trik je v preimenovati pila s. Razširitvijo TXT potem bi v datoteko Excel. SO first bring up “My Computer €? SO prvi bruhati "My Computer €? and navigate the folder to where the file resides. ter pluti mapo za datoteke, kjer prebiva.

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 €? Zdaj pa, če ne vidite datoteke. CSV (Windows je ta možnost privzeto onemogočena), sledite tem korakom, da bi pila razsežnost - Izberite meni "Tools €? / €? Možnosti mape €? then select the “View €? torej izbrati "View €? tab, uncheck the item “Hide extensions for known file types €? kartici, nenadzirljiv postavko "Skrij pripone za znane vrste datotek €? as the picture below: kot je slika spodaj:

Then you should see the file extension as such: Potem bi morali videti pripono kot tak:

Right click the file and select rename to rename the file to become “ProductInfo.txt €? Z desno tipko kliknite datoteko in izberite preimenovati v preimenovati datoteko, da postane "ProductInfo.txt €?

Notice the icon changes to regular text file icon as well. Obvestilo ikona spremeni v rednih text file icon enako. No open up Excel and use “File €?/ €?Open €? No odpreti Excel in uporaba "File €? / €? Open €? command to bring the file into Excel. ukaz, da bi v datoteko Excel. When you do this, a dialog will pop up like: Ko to storite, se bo pogovorno okno pop up, kot so:

Make sure the “Delimited €? Poskrbite, da "Delimited €? radio button is selected and click on “Next €? izbirni gumb je izbran, in kliknite na "Naprej €? button to continue. gumb za nadaljevanje. On the next screen, check the box “Comma €? Na naslednjem zaslonu, preverite polje "Comma €? and uncheck all other selections. ter počistite vse druge izbire.

Click on “Next €? Kliknite na "Next €? to advance to the next screen. napredovati v naslednjem zaslonu. In this screen, you need to click on the “SpecialID €? V tem zaslonu, morate klikniti na "SpecialID €? column and select the “Text €? stolpec in izberite "Text €? radiobutton from the “Column data format €? RadioButton iz "podatki stolpec format €? section. oddelek.

Click on “Finish €? Kliknite na "Finish €? then you are done. potem ste končali.

You can see now the column “SpecialID €? Ogledate si lahko zdaj stolpcu "SpecialID €? has been brought in as a Text column and all leading 0 are preserved. je bila vložena kot v stolpcu Besedilo in vse vodilne 0 so ohranjeni.
This method can be applied to any special circumstance for bringing in a CSV file into Excel including other delimited files. Ta metoda se lahko uporablja za vse posebne okoliščine za vložitev v datoteko CSV v Excel datotek, vključno z drugimi razmeji. 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. S sposobnost navedbo vrste podatkov za vsak stolpec v podatke uvoznice proces ste v veliko boljši nadzor na vaš končni rezultat.

Daily Email Updates Dnevni Email Updates
You can get our how-to articles in your inbox each day for free. Lahko dobite našo kako do člankov v vašo mapo »Prejeto vsak dan brezplačno. Just enter your name and email below: Preprosto vpišite vaše ime in e-pošto spodaj:


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. Drug način za to - še posebej, če kolona je določen TEVILO znakov, kot so "SpecialID" nad - preprosto označite kolone ali celice, ki jih želite popraviti, desno-kliknite Oblikuj celice ..., kliknite Po meri na kartici Number, in tip štiri ničle (ali pa več znakov področju je treba) in kliknite OK. Excel will automatically pad the field with leading zeros. Excel bo samodejno pad polje z ničlami.
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. Bonus te metode je, da lahko še vedno naredite izračune s številko brez uporabe zapletene formule za pretvorbo besedila "številka" v realno število.
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″). Tretja izbira, ob predpostavki, imate nadzor nad ustanovitev CSV, se za izvoz "SpecialID" polje kot formula, na primer, namesto izvoznic (0001), izvoz (= "0001"). That forces the value to be evaluated as text, as Excel evaluates the field as a text formula. To sile vrednost, ki se ocenjujejo kot besedilo, kot je Excel ovrednoti polje kot besedilo formula.
Thank you! Hvala! I was really struggling with this and appreciate the easy to follow instructions. Res sem se borila s to cenijo in enostavno sledite navodilom. My problem is solved! Moj problem je rešen!
Thanks much. Hvala lepa. This page helped me a lot — exactly the info I was looking for. Ta stran pomočnik mi veliko - točno info sem iskal.
Thanks all. Hvala vsem. This helped to solve my problem. To je pomagalo rešiti svoj problem.
when importing part number from a csv file some number cotaining E pri uvozu številka dela iz csv nekaj več 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. npr 977012e000 pri uvozu v Excel 2007 število na koncu videti kot 9770 + e lahko prosim mi svetuje, kako popraviti to v vsakem delu, ki vsebujejo število e se obravnava enako.
Thanks Hvala
Jim's option worked for me. Možnost Jim je delal za mene. No need to manipulate the file later. Ni potrebe, da manipulirajo datoteko pozneje.
Thanks Hvala
Jim's option is really simple when compared to other solutions out there and worked… thanks Jim možnost je zelo preprosta v primerjavi z drugimi rešitvami in tam delal ... hvala
i still can't solve my problem, jaz še vedno ne more rešiti svoj problem,
its same njeno enako
can,t open my .csv excel files in office 2007. lahko, t odprl. csv odlikovati se pila v urad 2007.