Front Office Football Central  

Go Back   Front Office Football Central > Archives > FOFC Archive
Register FAQ Members List Calendar Mark Forums Read Statistics

Reply
 
Thread Tools
Old 04-26-2007, 12:14 PM   #1
Ben E Lou
Morgado's Favorite Forum Fascist
 
Join Date: Oct 2000
Location: Greensboro, NC
Excel Question

I need to help someone who has a csv file that has dates in it, formatted as MMDDYYYY (04262007). I need to be able to go in and edit the file, but it is critical that the dates retain the leading zeros. The files that will need to be edited will have hundreds of rows, and 190 columns, so opening it with Notepad as a text file is completely impractical. The best-case scenario here would be for a way to configure Excel so that the default field format is "Text", rather than "General."

Help?
__________________
The media don't understand the kinds of problems and pressures 54 million come wit'!

Ben E Lou is offline   Reply With Quote
Old 04-26-2007, 12:30 PM   #2
Coder
College Prospect
 
Join Date: Nov 2000
Location: Gothenburg, Sweden
Do you have any way of affecting how the csv-file is written? Having "" around the "datefield" would indicate to Excel that it's a text-field I would think.

Other than that, when you open the file, is it immediately put into columns or are you faced with all data inside one column and you have to do "Text to Columns"?

If it's the latter, you have the chance to indicate what datatype a particular column is.
__________________
IFL - Vermont Mountaineers

~ I am an idiot, walking a tight rope of fortunate things ~
Coder is offline   Reply With Quote
Old 04-26-2007, 12:31 PM   #3
JonInMiddleGA
Hall Of Famer
 
Join Date: Nov 2000
Location: Behind Enemy Lines in Athens, GA
Quote:
Originally Posted by SkyDog View Post
The best-case scenario here would be for a way to configure Excel so that the default field format is "Text", rather than "General."
Help?

Maybe I'm making this simpler than it actually is, but if this is the optimum scenario, the third step of the import wizard allows you to define a column as text rather than general.

(I'm assuming that this csv is consistent & is ready for an easy import into Excel, and that the field with the leading zeroes needed is consistent across the entire file).
__________________
"I lit another cigarette. Unless I specifically inform you to the contrary, I am always lighting another cigarette." - from a novel by Martin Amis
JonInMiddleGA is offline   Reply With Quote
Old 04-26-2007, 12:34 PM   #4
Ben E Lou
Morgado's Favorite Forum Fascist
 
Join Date: Oct 2000
Location: Greensboro, NC
Quote:
Originally Posted by Coder View Post
Do you have any way of affecting how the csv-file is written? Having "" around the "datefield" would indicate to Excel that it's a text-field I would think.

Other than that, when you open the file, is it immediately put into columns or are you faced with all data inside one column and you have to do "Text to Columns"?

If it's the latter, you have the chance to indicate what datatype a particular column is.

No. I have no control. It is written by a third party.

To answer JIMGA's question, I don't get the wizard. It just opens straight up in Excel. The best workaround so far is to change it to .txt, then use the wizard to import in Excel, and change the format of that field. However, my hope is that there's some global setting in Excel that can be changed to do this before the file has to be opened.
__________________
The media don't understand the kinds of problems and pressures 54 million come wit'!
Ben E Lou is offline   Reply With Quote
Old 04-26-2007, 12:35 PM   #5
JonInMiddleGA
Hall Of Famer
 
Join Date: Nov 2000
Location: Behind Enemy Lines in Athens, GA
Quote:
Originally Posted by SkyDog View Post
However, my hope is that there's some global setting in Excel that can be changed to do this before the file has to be opened.

All I can say on that is that, if there is, I've never noticed it.
__________________
"I lit another cigarette. Unless I specifically inform you to the contrary, I am always lighting another cigarette." - from a novel by Martin Amis
JonInMiddleGA is offline   Reply With Quote
Old 04-26-2007, 12:37 PM   #6
Coder
College Prospect
 
Join Date: Nov 2000
Location: Gothenburg, Sweden
What happens if you Open the file through Excel's File->Open menu rather than double-click on the file? Don't you get the import-wizard then?
__________________
IFL - Vermont Mountaineers

~ I am an idiot, walking a tight rope of fortunate things ~
Coder is offline   Reply With Quote
Old 04-26-2007, 12:37 PM   #7
Ben E Lou
Morgado's Favorite Forum Fascist
 
Join Date: Oct 2000
Location: Greensboro, NC
Quote:
Originally Posted by Coder View Post
What happens if you Open the file through Excel's File->Open menu rather than double-click on the file? Don't you get the import-wizard then?
No. It opens right up.
__________________
The media don't understand the kinds of problems and pressures 54 million come wit'!
Ben E Lou is offline   Reply With Quote
Old 04-26-2007, 12:40 PM   #8
Wolfpack
Pro Rookie
 
Join Date: Feb 2003
Location: Raleigh, NC
Well, another way would be to open it up in Excel, then select the column with the date information, then go into the column's "Format Cell" properties and select "Custom" format for the "Number" and then type in the date/time format you like, e.g. "mm/dd/yy hh:mm:ss AM/PM" in the box available, then save. Excel tends to want to force such numbers into a default format of some kind, so this is a way to get around that. You'd probably need to save as an Excel file to retain the formatting, however. Otherwise, you'll need to re-apply the format change every time you open the CSV.
Wolfpack is offline   Reply With Quote
Old 04-26-2007, 12:41 PM   #9
Simms
FOBL Commish
 
Join Date: Oct 2000
Location: Team Radii
Open Excel.

Go to Data --> Import External Data --> Import Data.

Select your file.

You should get the wizard.
__________________
FOBL Commissioner
34 Productions Web Design
Simms is offline   Reply With Quote
Old 04-26-2007, 12:42 PM   #10
Coder
College Prospect
 
Join Date: Nov 2000
Location: Gothenburg, Sweden
What about this:

1) Open Excel, empty spreadsheet before you
2) Go to Data->Import External Data->Import Data
3) Select Textfiles and CSV files and open your file

Any luck?
__________________
IFL - Vermont Mountaineers

~ I am an idiot, walking a tight rope of fortunate things ~
Coder is offline   Reply With Quote
Old 04-26-2007, 12:42 PM   #11
Coder
College Prospect
 
Join Date: Nov 2000
Location: Gothenburg, Sweden
Simms stole my thunder!
__________________
IFL - Vermont Mountaineers

~ I am an idiot, walking a tight rope of fortunate things ~
Coder is offline   Reply With Quote
Old 04-26-2007, 01:24 PM   #12
GabeRivers
n00b
 
Join Date: Mar 2001
Location: Texas, USA
If the cells that are "formatted as MMDDYYYY (04262007)" are contained in the same column, you can do the following;

1. import into excel

2. In a temporary new column at far left of your spreadsheet, you will enter a formula that you will fill down:
=text([click on cell in same row with date reference],"00000000")

3. After filling down the formula, select the entire new column with the new formula entries (from top cell thru bottom); copy.

4. Now select the top cell of the column where the original date entries are and do a paste special/values.

5. Finally, delete the formula column and save your spreadsheet.

There is probably an easier way, but this will work.
GabeRivers is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is On
Forum Jump


All times are GMT -5. The time now is 10:39 AM.



Powered by vBulletin Version 3.6.0
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.