How to Delete Last Row from .csv file in perl

22 views
Skip to first unread message

AJAY PATIL

unread,
Aug 28, 2009, 8:19:04 AM8/28/09
to spreadsheet...@googlegroups.com
Hi ,

I've a perl script to convert .xls to .csv .After conversion I want to delete first 28 and the last row from .csv file.Is there any efficent way to achive this both together.

I'm deleting first 28 rows by using folllowing my perl code:

exec " tail -n+28 infile.csv > outfile.csv

I tried
exec " tail -n+28 infile.csv > infile.csv

but,it failed , I want to achive everthing in one file (infile.csv).I really don't need outfile.csv.
Is there any way to achive this using perl regexps ?
 
Thanks,
Ajay


--
Thanks,
Ajay

jmcnamara

unread,
Aug 28, 2009, 8:22:00 AM8/28/09
to Spreadsheet::WriteExcel

On Aug 28, 1:19 pm, AJAY PATIL <ajaypati...@gmail.com> wrote:
> Hi ,
>
> I've a perl script to convert .xls to .csv

Hi Ajay,

This is a forum to discuss Spreadsheet::WriteExcel. More general
questions should be direct at a forum such as Perlmonks: http://www.perlmonks.org/

John.
--

AJAY PATIL

unread,
Aug 28, 2009, 10:14:13 AM8/28/09
to spreadsheet...@googlegroups.com
ok John.I'll take care from here onwards
--
Thanks,
Ajay
Reply all
Reply to author
Forward
0 new messages