PC Review


Reply
Thread Tools Rate Thread

Capable CSV Tool... or make Excel not be "smart"

 
 
cosmin
Guest
Posts: n/a
 
      13th Mar 2006
I feel like banging my head against the wall. I have about 20000 records
that I export from PHPMyAdmin to CSV, to which I want to make some changes
so I can import them into another MYSQL table which has different columns.
The problem is that once I open that CSV in Excel it gets royally messed up,
due to its cursed "smart" routines.
For example, the fields which are in this format "2005-11-15" get changed to
"2005/11/15" because they are autodetected as dates and Excel knows better
than me what I want, right?
Also, when exporting from PHPMyAdmin, the data is like this

"0","Freeware","WinXP,Windows2000,Windows2003","1989",

After working with it in Excel it gets turned into this:

0,Freeware,"WinXP,Windows2000,Windows2003",1989,

As you can see, only some of the fields now have quotes, (why? It's Excel
being smart again and making the CSV inconsistent) which breaks my CSV
import script.
I'm going nuts. I've tried OpenOffice, which does the same thing, unquoting
some of the fields. Tried 602 PC Suite, it crashes when opening the original
CSV, which is about 23 MB, but whatever the cause, I can't try and see if it
works any better.
Tried a tool called DMCSV which is supposed to be a CSV editor, but it locks
up when trying to open the CSV file, because apparently it can't handle the
file's size.
So I'm really stuck. Is there anyway to get Excel to put quotes around all
the fields, so it can generate a consistent CSV.


 
Reply With Quote
 
 
 
 
Beege
Guest
Posts: n/a
 
      13th Mar 2006
I think we've talked about this before recently. Did you try:

Rename to .txt file.
open into Excel
Text Qualifier = None
Format each import as text - not general, not number, not date, just text.

HTH

Beege


"cosmin" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>I feel like banging my head against the wall. I have about 20000 records
>that I export from PHPMyAdmin to CSV, to which I want to make some changes
>so I can import them into another MYSQL table which has different columns.
>The problem is that once I open that CSV in Excel it gets royally messed
>up, due to its cursed "smart" routines.
> For example, the fields which are in this format "2005-11-15" get changed
> to "2005/11/15" because they are autodetected as dates and Excel knows
> better than me what I want, right?
> Also, when exporting from PHPMyAdmin, the data is like this
>
> "0","Freeware","WinXP,Windows2000,Windows2003","1989",
>
> After working with it in Excel it gets turned into this:
>
> 0,Freeware,"WinXP,Windows2000,Windows2003",1989,
>
> As you can see, only some of the fields now have quotes, (why? It's Excel
> being smart again and making the CSV inconsistent) which breaks my CSV
> import script.
> I'm going nuts. I've tried OpenOffice, which does the same thing,
> unquoting some of the fields. Tried 602 PC Suite, it crashes when opening
> the original CSV, which is about 23 MB, but whatever the cause, I can't
> try and see if it works any better.
> Tried a tool called DMCSV which is supposed to be a CSV editor, but it
> locks up when trying to open the CSV file, because apparently it can't
> handle the file's size.
> So I'm really stuck. Is there anyway to get Excel to put quotes around all
> the fields, so it can generate a consistent CSV.
>
>



 
Reply With Quote
 
cosmin
Guest
Posts: n/a
 
      14th Mar 2006
Doesn't work. It messes up even worse. Now fields from one column end up on
another.


"Beege" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>I think we've talked about this before recently. Did you try:
>
> Rename to .txt file.
> open into Excel
> Text Qualifier = None
> Format each import as text - not general, not number, not date, just text.
>
> HTH
>
> Beege
>
>
> "cosmin" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>>I feel like banging my head against the wall. I have about 20000 records
>>that I export from PHPMyAdmin to CSV, to which I want to make some changes
>>so I can import them into another MYSQL table which has different columns.
>>The problem is that once I open that CSV in Excel it gets royally messed
>>up, due to its cursed "smart" routines.
>> For example, the fields which are in this format "2005-11-15" get changed
>> to "2005/11/15" because they are autodetected as dates and Excel knows
>> better than me what I want, right?
>> Also, when exporting from PHPMyAdmin, the data is like this
>>
>> "0","Freeware","WinXP,Windows2000,Windows2003","1989",
>>
>> After working with it in Excel it gets turned into this:
>>
>> 0,Freeware,"WinXP,Windows2000,Windows2003",1989,
>>
>> As you can see, only some of the fields now have quotes, (why? It's Excel
>> being smart again and making the CSV inconsistent) which breaks my CSV
>> import script.
>> I'm going nuts. I've tried OpenOffice, which does the same thing,
>> unquoting some of the fields. Tried 602 PC Suite, it crashes when opening
>> the original CSV, which is about 23 MB, but whatever the cause, I can't
>> try and see if it works any better.
>> Tried a tool called DMCSV which is supposed to be a CSV editor, but it
>> locks up when trying to open the CSV file, because apparently it can't
>> handle the file's size.
>> So I'm really stuck. Is there anyway to get Excel to put quotes around
>> all the fields, so it can generate a consistent CSV.
>>
>>

>
>



 
Reply With Quote
 
Beege
Guest
Posts: n/a
 
      14th Mar 2006
cosmin,

So I tried it again. Renamed to .txt file
File /open/ test.txt
fixed width type file
created break lines where needed, including separating out the commas that
didn't want to mix with data.
Left formatted as "general"
finished opening.

Came out with quotes where they were in the .csv file.

Maybe??

Beege



"cosmin" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> Doesn't work. It messes up even worse. Now fields from one column end up
> on another.
>
>
> "Beege" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>>I think we've talked about this before recently. Did you try:
>>
>> Rename to .txt file.
>> open into Excel
>> Text Qualifier = None
>> Format each import as text - not general, not number, not date, just
>> text.
>>
>> HTH
>>
>> Beege
>>
>>
>> "cosmin" <(E-Mail Removed)> wrote in message
>> news:(E-Mail Removed)...
>>>I feel like banging my head against the wall. I have about 20000 records
>>>that I export from PHPMyAdmin to CSV, to which I want to make some
>>>changes so I can import them into another MYSQL table which has different
>>>columns. The problem is that once I open that CSV in Excel it gets
>>>royally messed up, due to its cursed "smart" routines.
>>> For example, the fields which are in this format "2005-11-15" get
>>> changed to "2005/11/15" because they are autodetected as dates and Excel
>>> knows better than me what I want, right?
>>> Also, when exporting from PHPMyAdmin, the data is like this
>>>
>>> "0","Freeware","WinXP,Windows2000,Windows2003","1989",
>>>
>>> After working with it in Excel it gets turned into this:
>>>
>>> 0,Freeware,"WinXP,Windows2000,Windows2003",1989,
>>>
>>> As you can see, only some of the fields now have quotes, (why? It's
>>> Excel being smart again and making the CSV inconsistent) which breaks my
>>> CSV import script.
>>> I'm going nuts. I've tried OpenOffice, which does the same thing,
>>> unquoting some of the fields. Tried 602 PC Suite, it crashes when
>>> opening the original CSV, which is about 23 MB, but whatever the cause,
>>> I can't try and see if it works any better.
>>> Tried a tool called DMCSV which is supposed to be a CSV editor, but it
>>> locks up when trying to open the CSV file, because apparently it can't
>>> handle the file's size.
>>> So I'm really stuck. Is there anyway to get Excel to put quotes around
>>> all the fields, so it can generate a consistent CSV.
>>>
>>>

>>
>>

>
>



 
Reply With Quote
 
Mark Lincoln
Guest
Posts: n/a
 
      14th Mar 2006
cosmin wrote:
----------
"0","Freeware","WinXP,Windows2000,Windows2003","1989",
After working with it in Excel it gets turned into this:

0,Freeware,"WinXP,Windows2000,Windows2003",1989,

As you can see, only some of the fields now have quotes, (why? It's
Excel being smart again and making the CSV inconsistent)
----------

I don't see inconsistency here. The imported data without quotes were
surrounded with quotes in the CSV file. Excel removes the quotes when
data is presented this way. The imported fields still containing
quotes only contain one double-quote character each:

"WinXP

Windows2003"

and Excel imported them as is as it cannot be determined that they are
not part of the data.

(If you expected to see a field like:

WinXP,Windows2000,Windows2003

it won't happen because the commas are delimiters.)

 
Reply With Quote
 
cosmin
Guest
Posts: n/a
 
      14th Mar 2006
You don't get it. Or maybe I wasn't clear. It's the fact that it selectively
removes quotes around columns that annoys me. If you look at the "before"
and "after" case, you can see that it removed the quotes for most of the
columns, and only kept those along the field which contains commas.



"Mark Lincoln" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> cosmin wrote:
> ----------
> "0","Freeware","WinXP,Windows2000,Windows2003","1989",
> After working with it in Excel it gets turned into this:
>
> 0,Freeware,"WinXP,Windows2000,Windows2003",1989,
>
> As you can see, only some of the fields now have quotes, (why? It's
> Excel being smart again and making the CSV inconsistent)
> ----------
>
> I don't see inconsistency here. The imported data without quotes were
> surrounded with quotes in the CSV file. Excel removes the quotes when
> data is presented this way. The imported fields still containing
> quotes only contain one double-quote character each:
>
> "WinXP
>
> Windows2003"
>
> and Excel imported them as is as it cannot be determined that they are
> not part of the data.
>
> (If you expected to see a field like:
>
> WinXP,Windows2000,Windows2003
>
> it won't happen because the commas are delimiters.)
>



 
Reply With Quote
 
cosmin
Guest
Posts: n/a
 
      14th Mar 2006
I think all the apps I've tried so far have problems with line breaks in the
content


I have a row which looks like this:

,"579","90","font renamer, freeware renamer, fonts rename","Got a font
collection? Got a collection, but no order in it? Start by giving font files
the names corresponding to the full font names. For example, you can rename
MLON_I.TTF to Milion Italic.ttf. This name speaks for itself, it is simple
and clear.

How to do it?

Easily. Select a folder with fonts and click the Rename button. That's all.
The program itself will find out which font each file contains and give it
the corresponding
name.","http://www.styopkin.com/free_font_renamer.html","http://www.styopkin.com/images/Screenshots/Screenshot-Free-Font-Renamer-256-192.gif","http://www.styopkin.com/PAD-Free-Font-Renamer.xml","http://www.styopkin.com/FreeFontRenamerSetup.exe","none","0","90","none","none","none","none","90","90","90","Graphic
Apps::Font Tools","Font Tools,Fonts Tools,Font,Fonts","90","Give each font a
name that speaks for itself.","Give each font a name that speaks for itself
with one click! Batch Font
Renamer.","http://www.styopkin.com/images/ICO_FFR.gif",NULLHow to do it?

Easily. Select a folder with fonts and click the Rename button. That's all.
The program itself will find out which font each file contains and give it
the corresponding name.",,NULL


This, and other rows like this break Excel. It makes a mess of my sheet when
importing.
Any way I can get it to ignore line breaks in content?



"cosmin" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> You don't get it. Or maybe I wasn't clear. It's the fact that it
> selectively removes quotes around columns that annoys me. If you look at
> the "before" and "after" case, you can see that it removed the quotes for
> most of the columns, and only kept those along the field which contains
> commas.
>
>
>
> "Mark Lincoln" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>> cosmin wrote:
>> ----------
>> "0","Freeware","WinXP,Windows2000,Windows2003","1989",
>> After working with it in Excel it gets turned into this:
>>
>> 0,Freeware,"WinXP,Windows2000,Windows2003",1989,
>>
>> As you can see, only some of the fields now have quotes, (why? It's
>> Excel being smart again and making the CSV inconsistent)
>> ----------
>>
>> I don't see inconsistency here. The imported data without quotes were
>> surrounded with quotes in the CSV file. Excel removes the quotes when
>> data is presented this way. The imported fields still containing
>> quotes only contain one double-quote character each:
>>
>> "WinXP
>>
>> Windows2003"
>>
>> and Excel imported them as is as it cannot be determined that they are
>> not part of the data.
>>
>> (If you expected to see a field like:
>>
>> WinXP,Windows2000,Windows2003
>>
>> it won't happen because the commas are delimiters.)
>>

>
>


 
Reply With Quote
 
Mark Lincoln
Guest
Posts: n/a
 
      14th Mar 2006
> You don't get it. Or maybe I wasn't clear.

I misread your example. My apologies.

> It's the fact that it selectively
> removes quotes around columns that annoys
> me. If you look at the "before"
> and "after" case, you can see that it removed
> the quotes for most of the columns, and only
> kept those along the field which contains commas.


>From Excel97 Help:


"The CSV (Comma delimited) file format saves
only the text and values as they are displayed
in cells of the active worksheet. All rows and
all characters in each cell are saved. Columns
of data are separated by commas, and each
row of data ends in a carriage return. If a cell
contains a comma, the cell contents are
enclosed in double quotation marks."

The last sentence is the key here. Excel is apparently importing
fields with commas the same way it writes them. But in a quick test, I
can't make it do that; when I import such a field (from a .csv or a
..txt file) it throws out the quotation marks. Curious.

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Selecting Text - How can I make it less "Smart" ? =?Utf-8?B?Z2xvY3BldGU=?= Windows XP General 2 11th Aug 2006 05:45 PM
how can I make an excel cell "mark" or "unmark" when clicked on? =?Utf-8?B?Umljaw==?= Microsoft Excel Misc 6 8th Jan 2006 10:15 PM
Make Word's "Proper Case" tool work properly =?Utf-8?B?bWFzdGVyX29iamVjdGlzdA==?= Microsoft Word Document Management 8 10th Nov 2005 11:49 PM
make "find option" available in tool bar like adobe or firefox =?Utf-8?B?am9zaA==?= Microsoft Word Document Management 0 16th Apr 2005 10:19 PM
Make Excel's "grab and drag" behave like cut and paste "values only" ? tur13o Microsoft Excel Misc 5 14th Nov 2003 01:07 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 09:46 PM.