Excel - Preserving Leading Zeros in a CSV File

แชร์
ฝัง
  • เผยแพร่เมื่อ 1 ธ.ค. 2024

ความคิดเห็น • 68

  • @spectrepro
    @spectrepro 4 ปีที่แล้ว +2

    Append "-0000" to the end of the number if it is a zip code in whatever system you are exporting the data from. This will also keep leading zero's after saving the file as a .csv. This permanently fixed my issue, but it was good learning this method too.

  • @bharatthapa2736
    @bharatthapa2736 4 ปีที่แล้ว

    You saved my days. I viewed to many videos and read articles, not found accurate as yours. Thank you.

  • @mehulkaria
    @mehulkaria 5 ปีที่แล้ว +17

    Even after following steps, if you save file as CSV and open it will not show 0. What should we do if we have can send only .csv file and need to see 0 upfront.

    • @IQAcctSolutions
      @IQAcctSolutions  5 ปีที่แล้ว +2

      I'm sorry I didn't see your comment sooner. If you want to confirm that the 0 is still there, open the file in a text editor such as Notepad instead of re-opening it in Excel.
      CSV files are pure text files that contain no formatting. So even though you formatted a column as text in Excel, that format is not preserved in the CSV file.

    • @anssi9137
      @anssi9137 4 ปีที่แล้ว

      @@IQAcctSolutions Thanks for this tip.

    • @tylercanale2655
      @tylercanale2655 3 ปีที่แล้ว

      @@IQAcctSolutions Just to confirm what you mean, even though the .csv doesn't show the 0, it is still there if you follow this process?

    • @IQAcctSolutions
      @IQAcctSolutions  3 ปีที่แล้ว

      ​@@tylercanale2655 That's correct. If you go through this process your CSV files will have the leading zeros. If you open that file in a text editor you will see the zeros. If you open the CSV file in Excel in the normal manner it will strip out the leading zeros again. If you just close Excel without saving changes you haven't done any damage. But if you save the CSV file in Excel the leading zeros will be gone.

    • @Sudarshann24
      @Sudarshann24 3 ปีที่แล้ว

      So there is no solution to save the file as a csv file and still retain the leading zeros after following the steps you have showed us in the video? The reason I’m asking is that I will need to upload the csv file onto another tool.. and I can’t do it without saving it as csv..

  • @David-in3go
    @David-in3go หลายเดือนก่อน

    I followed your steps and I was able to get all the leading zeros back the TXT file. However, after I saved that file into another CSV file, when I opened the file, those leading zeros were gone again.

  • @JamesCivitello
    @JamesCivitello ปีที่แล้ว

    This solved my problem, thank you very much! I was going crazy trying to solve this.

  • @neilguylindberg6672
    @neilguylindberg6672 4 ปีที่แล้ว +1

    Great video, unfortunately I need the opposite. I'm getting an XLS that I open and the column has the little green triangle for every left zero padded number "01234", but then on EXPORT TO CSV I can't find a way to preserve that. So, then my CSV already has the wrong value, so I can't use this trick. Do you have a related video going the other way, i.e., if you took your Excel at the end here and tried to export it as CSV?

    • @IQAcctSolutions
      @IQAcctSolutions  4 ปีที่แล้ว

      If you open the CSV file in Notepad or some other text editor after exporting it from Excel, are the leading zeros still there?

    • @neilguylindberg6672
      @neilguylindberg6672 4 ปีที่แล้ว

      @@IQAcctSolutions No. But, what I did end up doing was write a NodeJS helper that reads the file into a buffer, and then writes it out line-by-line, at which time I thought I would apply needed pad left ("0", 8), to ensure length is 8, with leading zeros. But, just NOT opening it in Excel in the first place, but rather reading the XLS into a buffer and writing it back out to CSV works. It is really weird to me that this problem even exists. I would imagine many people have run into this issue. I thank you very much for your reply.

  • @ravikumarenthu
    @ravikumarenthu 2 ปีที่แล้ว

    THANKS A TONNNNNNNN.. loosing leading zeros was driving me nuts

  • @nkosanadhlamini8313
    @nkosanadhlamini8313 4 ปีที่แล้ว

    We normally load our TB in SAP BPC that accepts only CSV formatted files and had the leading zeroes issue. Can that CSV.TXT file be loaded as if it was a CSV file onto this system?

  • @tusharsoni1648
    @tusharsoni1648 3 ปีที่แล้ว

    Information I was looking for. Thank you sharing.

  • @datta123ify
    @datta123ify 3 ปีที่แล้ว

    Thank you. Was looking for this information.

  • @adrianb9653
    @adrianb9653 5 ปีที่แล้ว +1

    Dude, you are a god.

  • @SavvySteveChannel
    @SavvySteveChannel 5 ปีที่แล้ว

    Thank you, this worked fine for me once I slowed down and followed the import wizard and picked text format on the columns I needed the leading zeros.

  • @bryanmyers9977
    @bryanmyers9977 4 ปีที่แล้ว

    If you start with an excel file with leading zeros do this (using 365 mac): select all cells and convert to text. Then export to CSV.

  • @therealmoftoys275
    @therealmoftoys275 3 ปีที่แล้ว

    This just saved me hours of work, thank you so much! More than anything, thank you for the end explanation if the file type wasn't showing up in the folder. Mine wasn't and I tried it a few times then figured uhhh...maybe I should just watch the rest of the video... haha.

  • @johnurbanski2057
    @johnurbanski2057 7 ปีที่แล้ว +1

    Went through the steps, saved the file. But when I reopen the file, the zeros are gone. They are getting removed when saving the file. Is there some setting that is automatically removing them when saved?

    • @IQAcctSolutions
      @IQAcctSolutions  7 ปีที่แล้ว

      A CSV file is a plain text file, so it doesn't retain any formatting. If you saved the files as a CSV and then open it in Notepad you would see that the zeros are still there. But if you open it in Excel again without going through the process described in the video, Excel will remove the zeros upon opening.
      If you will be repeatedly opening and editing a file it may be easier to save it as an Excel file. You can always save as a CSV again later if needed.

  • @annecastilho3923
    @annecastilho3923 5 ปีที่แล้ว

    What if there are too many columns in the file and you can't manage to select the one you want to convert into text (minute 1:33)? This window isn't expandable and the arrow in the keyboard doesn't work. Help!!!

    • @martinpatsov2577
      @martinpatsov2577 4 ปีที่แล้ว

      If applying text to all columns is a solution for you: select a single column then press ctrl+a and then apply them as text

  • @andrew1436
    @andrew1436 6 ปีที่แล้ว

    This was incredibly helpful as I was really frustrated with Excel! Thank you!

    • @IQAcctSolutions
      @IQAcctSolutions  6 ปีที่แล้ว

      You're welcome. I'm glad it I remember that feeling all too well.

  • @weedee77
    @weedee77 6 ปีที่แล้ว

    Just the information I was looking for. Thanks man.

  • @santubiswas6809
    @santubiswas6809 5 ปีที่แล้ว

    Thanks for detail information about the process

  • @donnyuser794
    @donnyuser794 6 ปีที่แล้ว

    That is nice; but if you had full addresses in there which contain a comma how would you split the data so the address wasn't split. EXAMPLE: In one field in the .csv I could have '123 str N, suite 102',05123. How would you make sure you didn't split on the unplanned commas? CSVs just nest the comma in single quotes, so this does not seem to maintain the .csv file format.
    Any suggestions or workarounds? I had thought of filtering on contains '*,*' and then take a manual effort on the ones that do contain this.

    • @IQAcctSolutions
      @IQAcctSolutions  6 ปีที่แล้ว

      Any string that contains commas as part of the data should be surrounded in double quotes. And that is exactly why it's so hard to deal with data that contains double quotes, such as when " is used as the symbol for inches. As soon as Excel hits the inch symbol, it starts ignoring commas until if finds another double quote which may be any number of fields or even records away, and everything in between gets parsed into one field.

  • @pelosilee9451
    @pelosilee9451 5 ปีที่แล้ว +3

    After the above steps we get txt files rather than csv file.

    • @bigpapykane
      @bigpapykane 3 ปีที่แล้ว

      Yea, this was not helpfull if you want it to be csv

  • @xsupremeyx9923
    @xsupremeyx9923 3 ปีที่แล้ว

    I'm having problem where even after doing this, when i ask my python program to read the .csv file to get the passwords from, it reads them as xxxx instead of 0xxxx even after changing my info.csv using this

    • @IQAcctSolutions
      @IQAcctSolutions  3 ปีที่แล้ว

      Check the CSV file by opening it in Notepad or some other text editor. If the leading zeros are there, then you know you need to look for a solution in Python.

  • @allisonramsey-henry5303
    @allisonramsey-henry5303 4 ปีที่แล้ว

    This saved me today. Thank you.

  • @hardikpatel3395
    @hardikpatel3395 4 ปีที่แล้ว

    Thank you . It worked for me.

  • @vieira.leandro
    @vieira.leandro 5 ปีที่แล้ว

    Thank you! This saved a lot of time!

  • @mohdhanafi8599
    @mohdhanafi8599 5 ปีที่แล้ว

    Thanks. You made my day. Appreciate it.

  • @meganperry2962
    @meganperry2962 4 ปีที่แล้ว

    Problem - after I rename it to .txt the excel because unusable, won’t let me open it as excel, only in notepad???

    • @IQAcctSolutions
      @IQAcctSolutions  4 ปีที่แล้ว

      After you rename it to .txt you need to go back to Excel, go to File > Open and browse to the file's location. In the File Open window change the file type to "Text Files (*.prn; *.txt; *.csv)". Then you'll be able to open your file.

  • @stephaniebeck335
    @stephaniebeck335 5 ปีที่แล้ว

    Thank you! Very helpful.

  • @dannyknowlton
    @dannyknowlton 5 ปีที่แล้ว

    Great job. Thanks for your help!

  • @evry1loveronica
    @evry1loveronica 6 ปีที่แล้ว

    finally found you! thanks for the awesome vid

  • @Skyebirdtucker
    @Skyebirdtucker 4 ปีที่แล้ว

    Once resave as a CSV it does NOT keep the leading zeros.

  • @luthifer01
    @luthifer01 7 ปีที่แล้ว

    Thanks for this video. Unfortunately this wouldn't work for automated solutions. I think Microsoft needs to address this problem and stop ignoring it.

    • @shafiqrezal2855
      @shafiqrezal2855 5 ปีที่แล้ว

      it woks fine with photoshop automate.

  • @preetipatel8323
    @preetipatel8323 5 ปีที่แล้ว

    thank you - very helpful

  • @silverserfer5121
    @silverserfer5121 8 ปีที่แล้ว

    Thanks so much for the video!

    • @IQAcctSolutions
      @IQAcctSolutions  8 ปีที่แล้ว

      +Silver Serfer You're welcome. I hope it saved you some time and aggravation.

  • @Verses01
    @Verses01 6 ปีที่แล้ว

    Awesome...sauce. Thank you!

  • @C0mm0nS3ns3
    @C0mm0nS3ns3 6 ปีที่แล้ว

    yea leading 000s are fun when doing integrations...

  • @wraggal
    @wraggal 4 ปีที่แล้ว

    THANKYOU!!

  • @marissasharp2659
    @marissasharp2659 5 ปีที่แล้ว

    Thank you!

  • @vladimirkisyov5782
    @vladimirkisyov5782 6 ปีที่แล้ว

    Good job ;) !!!

  • @avrianpradiptya7061
    @avrianpradiptya7061 4 ปีที่แล้ว

    Thanks

  • @ABirdDad
    @ABirdDad 5 ปีที่แล้ว

    thanks man

  • @TKamal
    @TKamal 6 ปีที่แล้ว +2

    I F'IN LOVE YOU

  • @annachan6706
    @annachan6706 3 ปีที่แล้ว

    skip the first 30 seconds, play at 1.25 speed

  • @Chandler890
    @Chandler890 3 ปีที่แล้ว

    2021, any updated ways?

  • @Mrcloc
    @Mrcloc 5 ปีที่แล้ว

    You don't have to rename it to a text file. You just have to open Excel, and then open the file from Excel rather than opening the file from the file system.

    • @shafiqrezal2855
      @shafiqrezal2855 5 ปีที่แล้ว

      this may only work when you are working with excel only. some people use same file in other program such as photoshop.

    • @Mrcloc
      @Mrcloc 5 ปีที่แล้ว

      @@shafiqrezal2855 I actually found that some files I needed to rename, so once again with Microsoft - do the same thing and expect different results.

  • @maraeak-s5067
    @maraeak-s5067 8 ปีที่แล้ว

    WHAT IF YOUR USING A MAC AND IT DOES NOT SHOW YOUR FILE OPTIONS

    • @IQAcctSolutions
      @IQAcctSolutions  8 ปีที่แล้ว

      Sorry but I've never used Excel on a Mac so I don't know the answer.

    • @C0mm0nS3ns3
      @C0mm0nS3ns3 6 ปีที่แล้ว

      go look up how to change file extensions or show them

    • @g30rg3-c5
      @g30rg3-c5 5 ปีที่แล้ว

      It's actually easier in Numbers for MAC, here is a TH-cam tutorial th-cam.com/video/a45S_8hS-hc/w-d-xo.html

  • @g30rg3-c5
    @g30rg3-c5 5 ปีที่แล้ว

    If you are looking for the same solution in Numbers for MAC follow this TH-cam tutorial: th-cam.com/video/a45S_8hS-hc/w-d-xo.html