Jump to content
UBot Underground

How to stop my .csv from reading data as a date.


Recommended Posts

So I am creating a page scraper that pulls in account numbers from a site.

 

Typically the account numbers are in the format 111-222-333. There really isn't any standard number of numbers or dashes and I am able to scrape them all fine into a column into a .csv file.

 

The problem occurs when an account number happens to hit a number pattern that matches a date. (i.e. 3-3-09). My .csv file then tries to be helpful and converts the value to a date 03/03/09. While I am all for helpfulness, this really screws things up for me and I can't figure out how to make it stop doing it. When I go into format cells and try to change it from a date format to general or text, it then converts the date to the numeric value for that date instead of the scraped data of 3-3-09.

 

This really isn't even a ubot issue probably, but I am just looking to see if there is away around this.

 

Thanks for any help people can give.

Link to post
Share on other sites

I know it sounds like a very simple fix, but you can try saving it as a .txt with comma separated values when setting it up.

 

If it's not absolutely critical that you open it back up as a .csv, it won't automatically convert.

Link to post
Share on other sites

Yeah...it's an excel formatting issue...As Justin suggested, you really don't need to use Excel to accomplish what you want to do. (a csv file IS a text file and can be viewed as such)

 

John

Link to post
Share on other sites

Thanks, I've set up the bot so that it saves the file as both a .csv and as a.txt for the client. The data in the .txt file looks correct and it is an excel/open office formatting issue.

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...