If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > MySQL > exporting to txt file

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 06-08-04, 15:43
Strikerz95 Strikerz95 is offline
Registered User
 
Join Date: May 2004
Posts: 28
exporting to txt file

I run a MySQL script that exports to a txt file. It works right except the last 2 lines of the txt file are unnecessary and display a grand total. Is there any command that turns writing that line off or something? Here is what the end of the txt file looks like:

Code:
"BHoneycutt","Honeycutt","Brie","BHoneycutt@christianheritage.edu","bh010161","010161","A"
"LLewis","Lewis","Lloyd","LLewis@christianheritage.edu","ll010165","010165","K"
"CPickel","Pickel","Carl","CPickel@christianheritage.edu","cp010195","010195","T"
"LTyler","Tyler","Linda","LTyler@christianheritage.edu","lt010199","010199","J"
"Grand Total:","Grand Total:","","Grand Total:@christianheritage.edu","g334","334",""
"","","","@christianheritage.edu","","",""
The script looks like this:

Code:
SELECT DISTINCT concat_ws(       
	 '',
	 '"',
	 (
	    concat_ws(            
 	      '","',
	      concat_ws('',dept_id,crse_id),
	      descr_label
            )
         ),
         '"'
       )
FROM chc_students INTO OUTFILE "/blackboard_create_courses.txt";

Last edited by Strikerz95; 06-08-04 at 15:45.
Reply With Quote
  #2 (permalink)  
Old 06-08-04, 15:47
Leaden Leaden is offline
Registered User
 
Join Date: Dec 2003
Location: Houston, TX
Posts: 21
phpMyAdmin will export to CVS.

Are the the last two lines blank or how you have them listed it here.

Quote:
"Grand Total:","Grand Total:","","Grand Total:@christianheritage.edu","g334","334",""
"","","","@christianheritage.edu","","",""
__________________
I do not fear computers. I fear the lack of them.
-Isaac Asimov (1920 - 1992)
Reply With Quote
  #3 (permalink)  
Old 06-08-04, 16:25
Strikerz95 Strikerz95 is offline
Registered User
 
Join Date: May 2004
Posts: 28
Those are the two unnecessary lines that I do no want included in the txt file
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On