+ Reply to Thread
Results 1 to 6 of 6

Overcoming date formatting changes in csv file

  1. #1
    Forum Contributor
    Join Date
    11-06-2021
    Location
    Tripoli
    MS-Off Ver
    Still using 2007 in 2023
    Posts
    289

    Red face Overcoming date formatting changes in csv file

    Hello everyone, I hope you're all doing well.
    I'm dealing with an Excel sheet that contains a set of values which are to be barcodes.
    I need these barcodes in column B to be fixed either as number or text, ensuring that they are treated as text even if they resemble a date, such as '2225-03-01'.
    The reason for this is that when the format changes to a date, I encounter issues uploading the file into my accounting program.

    I've attempted various methods, including adding an apostrophe, adjusting the date settings in Windows, and using the TEXT formula to bind it to a date format but without being as date. Unfortunately, none of these approaches have been successful.

    My primary concern is that when the CSV file is reopened, the values originally formatted as dates should still be treated as text. I appreciate any assistance in achieving this objective.

    Thanks a lot for your assistance.
    Attached Files Attached Files
    Last edited by hasan mougharbel; 12-25-2023 at 02:05 PM.

  2. #2
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP and 2007
    Posts
    15,829

    Re: Overcoming date formatting changes in csv file

    I'm not sure I understand exactly where in your process these text strings are being converted to dates. If I open your text file in a text editor, they appear to all be correct xxxx-xx-xx text strings. I have no trouble opening/importing the file into Excel, as long as I use an open/import method that allows me to prevent Excel from interpreting that field as dates. I find that debugging and resolving these kinds of issues often comes down to understanding exactly when the text gets converted to a date. Usually, this is the open/reopen/import step. Help us understand how you are opening/reopening/importing these text files.
    Quote Originally Posted by shg
    Mathematics is the native language of the natural world. Just trying to become literate.

  3. #3
    Valued Forum Contributor
    Join Date
    08-31-2007
    Location
    SW Ireland
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2311 Build 16.0.17029.20068) 32-bit
    Posts
    523

    Re: Overcoming date formatting changes in csv file

    The attached image (3 separate stages shown) shows how you can check that the barcodes are kept in the '2225-03-01' format.In the last stage, chose 'text' from the pop-up menu

    Convert data.jpg
    Excel 365 user. To unblock a downloaded macro-enabled workbook, go to your "Downloads" folder > right click on the workbook name > click 'Properties' > check the 'Unblock' checkbox. You can now open the workbook.

  4. #4
    Forum Expert
    Join Date
    07-23-2018
    Location
    UK
    MS-Off Ver
    O365 32bit (Windows)
    Posts
    1,980

    Re: Overcoming date formatting changes in csv file

    Look for the Data tab in the Ribbon, then Get External Data

    Next,in the Import Dialog, browse to and open the CSV file.

    This should bring up the text import wizard.
    1. Choose Delimited
    2. Tick Headers
    3. Click Next
    4. Only select Comma
    5. Click Next
    6. Select the column which gets misinterpreted
    7. Choose Text
    8. Click Finish
    Attached Images Attached Images
    Last edited by ByteMarks; 12-27-2023 at 01:17 PM. Reason: Legacy method

  5. #5
    Forum Contributor
    Join Date
    11-06-2021
    Location
    Tripoli
    MS-Off Ver
    Still using 2007 in 2023
    Posts
    289

    Re: Overcoming date formatting changes in csv file

    I express my gratitude to everyone who contributed to resolving my issue. At last, the solution was found by first converting the date format values to text using the TEXT formula. Then after making these changes, I closed the file and uploaded it directly to the software without reopening it. It's important to note that the problem arose when attempting to reopen the file, as the date format reverted to its original state, causing incorrect loading into the software. Therefore, my workaround was to avoid opening the CSV file, ensuring that the text-formatted dates remained intact during the upload process. I share this experience with the hope that it may benefit others facing a similar issue in the future. Thank you all for your assistance and consideration, and I express my gratitude with an added reputation for the above.

  6. #6
    Forum Expert
    Join Date
    07-23-2018
    Location
    UK
    MS-Off Ver
    O365 32bit (Windows)
    Posts
    1,980

    Re: Overcoming date formatting changes in csv file

    Great to hear.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] overcoming the Nested IF - more than 64
    By JavaPop in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 07-17-2020, 06:16 AM
  2. [SOLVED] Overcoming CountIf Limit
    By AcrimoniousMirth in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 08-09-2016, 06:08 AM
  3. Overcoming a circular reference
    By Thistledown in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 09-04-2013, 11:20 AM
  4. Multiple conditional formatting - overcoming -ve divisors
    By Monkeyfuzzle in forum Excel General
    Replies: 1
    Last Post: 11-15-2011, 12:23 PM
  5. Replies: 3
    Last Post: 08-18-2010, 12:58 PM
  6. Overcoming greater than 7 if statements
    By puffer in forum Excel General
    Replies: 6
    Last Post: 04-28-2009, 02:06 PM
  7. overcoming nested IF limitations...with VBA?
    By JLC in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 11-07-2005, 07:10 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1