473,386 Members | 1,785 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Add blank rows to a CSV file

I have a program that goes to a MySQL table and puts all the data of the table in a CSV file, now I want to leave 6 rows in blank at top of the file when open in Excel, but I dont know how to do that.


I use these to put all the data to into the csv file

Expand|Select|Wrap|Line Numbers
  1. my $sql = "SELECT * INTO OUTFILE 'c:/proyecto/$filename'
  2. FIELDS TERMINATED BY ','
  3. LINES TERMINATED BY '\r\n' FROM t3132";
can someone help me with these problem?

Thank you
Jan 9 '08 #1
2 2573
KevinADC
4,059 Expert 2GB
I have a program that goes to a MySQL table and puts all the data of the table in a CSV file, now I want to leave 6 rows in blank at top of the file when open in Excel, but I dont know how to do that.


I use these to put all the data to into the csv file

Expand|Select|Wrap|Line Numbers
  1. my $sql = "SELECT * INTO OUTFILE 'c:/proyecto/$filename'
  2. FIELDS TERMINATED BY ','
  3. LINES TERMINATED BY '\r\n' FROM t3132";
can someone help me with these problem?

Thank you
Where is your code that produces the CSV output and writes it to a excel file? That is where you would insert a blank line.
Jan 9 '08 #2
As Kevin said..
use the following statement at the place where you have to leave empty rows.

print "\n" x 6; # as you mentioned 6 empty rows are needed.
Jan 10 '08 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

12
by: dan glenn | last post by:
Hi. I'm finding that if I have text entered into a <textarea ...> </textarea> in a form, and that text has leading blank lines (with no spaces or anything else), that when I retrieve the entered...
2
by: Roy | last post by:
Hi all, I do have a datatable that looks like: id Number Description 1 1 Desc1 2 1 Desc2 3 2 Desc3 I need this datatable looks like (with 4 rows...
9
by: Kay | last post by:
Hi all, Could you tell me the best way to add a blank item(as first item) in a data binded combo box? Because I think I didn't do it right and it generate an error if the second item(after the...
2
by: Mike Charney | last post by:
I have a table that is created using the TransferText method. The file being imported has column headings in it for the data, but the first few rows after the headings are blank. The program that...
2
by: Drew | last post by:
Hi all - I've written a simple script to read a .csv file and then write out rows to a new file only if the value in the 4th column is a 0. Here's the code: import csv reader =...
11
by: techjohnny | last post by:
Ok, I posted earlier about this, a blank php page. I've enabled logging ALL in the php.ini, but nothing. If I change the name of the db in the include file, I get an error message, so I guess...
0
by: LizRickaby | last post by:
My client has several Access databased that they wanted converted into MSSQL to be able to access them online (excuse the pun). I added the first Access database, LenderPrograms, as a table in the...
0
by: Alex | last post by:
Hi, I am a complete beginner with Oracle 9i and XML within it, not XML alone though. I am trying to do a regular SELECT statement using the SQL Scratchpad within the Oracle Enterprise Manager and...
1
by: premMS143 | last post by:
Hi 1 & all, Using VB, How to remove blank rows in a Excel worksheet? For example, I'm having a Excel sheet containing 900 rows data, in which there are blank rows inserted in between. Manually...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.