rggadre April 4, 2012 at 04:44:52 Specs: Windows XP
I want to remove the row count which is appearing at the end of a csv file using a batch file I also want to remove leading commas and want to format the trailing ones. for e.g What I am getting:- ,Test1 , ,Test2 , What I want:- Test1,Test2
Ok,Thanks for your reply I am trying to extract some keywords from a stored procedure using a batch file and saving the ouput file as a csv file. so after the database connections(command line written in a batch file) I wrote the following line to get the output in a csv file -ooutput.csv -s"," I got the output as shown above I tried -W to trim spaces between the keyword and the trailing comma but didn't work. need a solution asap Thanks in advance.
Ok output.csv file is already created and I have used the following code grep -v -- ----- output.csv | tr -d [:blank:] > blanks.csv cut -c2-999 blanks.csv > final.csv rm output.csv rm blanks.csv exit Using this I am able to solve the leading and trailing commas issue but instead of cut and grep(unix commands) I want to use Windows cmd to do it. pls help asap
The information on Computing.Net is the opinions of its users. Such
opinions may not be accurate and they are to be used at your own risk.
Computing.Net cannot verify the validity of the statements made on this
site. Computing.Net and Purch hereby disclaim all responsibility
and liability for the content of Computing.Net and its accuracy.