I have a text file,that i got from running the sql query.There are 5 columns.I need to remove column
names and the "-------" under the column names.I did removed column names and "-------".That leaves 2
blank lines at starting of the file.I have 400 rows of data.After the data there is some text.I removed
that text also.That leaves 1 blank line at the bottom of the file.Can some body please tell me how to
remove those blank lines?
And i need to make that data as comma separated.
Example file: empData.txt
column1 column2 column3 coloum4 column5
--------- --------- --------- -------- --------
abcd N Y Bank of America 580 LA
xyz Y N Bank of Africa 765 DC
I started writing getEmpData.pl as follows.
`isql -Uusername -Ppwd -Sserver -isqlfile -oempData.txt`; #this line is to run sql query.
`perl -pi -e s/\.*empno.*//g empData.txt`; # to remove column names
`perl -pi -e s/\-*//g empData.txt`; # to remove ---------
`perl -pi -e s/\.*return.*//g empData.txt`; # to remove some text
I am new to perl.Just learning from two days.Can somebody help me out with this?