Need to generate .csv file


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Need to generate .csv file
# 1  
Old 12-29-2009
Need to generate .csv file

I have a csv file with the following data

Please find the attachment - zip

Code:
 
 
 
 
12/31/20081/7/20091/14/20091/21/20091/28/20092/4/20092/11/20092/18/20092/25/20093/4/20093/11/20093/18/20093/25/20094/1/20094/8/20094/15/20094/22/20094/29/20095/2/20095/13/20095/20/20095/27/20096/3/20096/10/20096/17/20096/24/20097/1/20097/8/20097/15/20097/22/20097/29/20098/5/20098/12/20098/19/20098/26/20099/2/20099/9/20099/16/20099/23/30099/30/200910/7/200910/14/200910/21/200910/28/200911/4/200911/11/200911/18/200911/25/200923967432967150000000000000000000000000000000000000000000011111111119999999444466661111111113131313141414141111111112121212121212126666555599993333


Can you pls help me to generate .csv file like this

We need to pass three parameters, < source_file> <Desn_file> <Destn_dir>

Can you pls help me with this

Code:
 
 
 
 
239674329671512/31/2008023967432967151/7/2009023967432967151/14/2009023967432967150239674329671502396743296715023967432967150239674329671502396743296715023967432967150239674329671502396743296715023967432967150239674329671502396743296715023967432967150239674329671502396743296715023967432967150239674329671502396743296715023967432967150239674329671511/18/20090239674329671511/25/2009011111199999912/31/200841111119999991/7/200941111119999991/14/2009411111199999911111199999911111199999911111199999911111199999911111199999911111199999911111199999911111199999911111199999911111199999911111199999911111199999911111199999911111199999911111199999911111199999911111199999911111199999911111199999911/18/2009311111199999911/25/20093

Thanks a lot

Last edited by vaas; 12-29-2009 at 11:50 AM..
# 2  
Old 12-29-2009
Question Please clarify your question

If you are working truly with a csv file, kindly include a small section of the text file. Also, include a section of what you want output to appear as.
Your original email was confusing (at least to me.)

Last edited by joeyg; 12-29-2009 at 12:41 PM..
# 3  
Old 12-29-2009
Thanks for your reply

I have attached sample.csv in zip herewith ,

I need to change the first row into the below o/p in Sample.csv file

Like wise it has to do for all the rows

Can you pls help with this
# 4  
Old 12-29-2009
The o/p file will be in .csv format..

The sample o/p is attached in excel here
# 5  
Old 12-29-2009
I see the following in the attached file:
Code:
",,12/31/2008,1/7/2009,1/14/2009,1/21/2009,1/28/2009,2/4/2009,2/11/2009,2/18/2009,2/25/2009,3/4/2009,3/11/2009,3/18/2009,3/25/2009,4/1/2009,4/8/2009,4/15/2009,4/22/2009,4/29/2009,5/2/2009,5/13/2009,5/20/2009,5/27/2009,6/3/2009,6/10/2009,6/17/2009,6/24/2009,7/1/2009,7/8/2009,7/15/2009,7/22/2009,7/29/2009,8/5/2009,8/12/2009,8/19/2009,8/26/2009,9/2/2009,9/9/2009,9/16/2009,9/23/3009,9/30/2009,10/7/2009,10/14/2009,10/21/2009,10/28/2009,11/4/2009,11/11/2009,11/18/2009,11/25/2009"
"239674,3296715,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1"
"239674,3300723,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1"
"239674,3304428,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0"

Please clarify what you want for output.
# 6  
Old 12-29-2009
Hi Joe

Pls find it in another excel sheet test_data.xls

Can you pls find it here , work sheet called "Data_toBe_Converted

Thanks
# 7  
Old 12-29-2009
Question Still unclear

Your original file appeared to have three rows of data.
What are you trying to do? I am not asking for you to tell me csv file (or Excel), but functionally what you are trying to do.
For example, are you trying to take the first field of each row and make a new file?
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Generate .csv/ xls file report

There can be thousand of .ksh in a specific directory where sql files are called from ksh. Requirement is to loop through all the files content and generate a report like below: Jobname Type type sqlname gemd1970 sql daily tran01 gemw1971 sql weekly ... (6 Replies)
Discussion started by: vedanta
6 Replies

2. Shell Programming and Scripting

Script to generate .csv file

Dears,I need your help in this, I have to create a report based on the output file generated by another program. I want to write a shell script for this. The output file generated every 15 minutes but i can’t open it until the end of day so the script will get the file as an input the file will be... (8 Replies)
Discussion started by: abdul2020
8 Replies

3. Shell Programming and Scripting

Script to generate csv file

Dears, I am new in shell world and I need your help in this, I have to create a report based on the output file generated by another program. I want to write a shell script for this. The output file generated every 15 minutes but i can’t open it until the end of day so the script will get the... (3 Replies)
Discussion started by: abdul2020
3 Replies

4. Shell Programming and Scripting

How to generate a csv files by separating the values from the input file based on position?

Hi All, I need help for doing the following. I have a input file like: aaaaaaaaaabbbbbbbbbbbbbbbbbbbb cccbbbbbaaaaaadddddaaaabbbbbbb now I am trying to generate a output csv file where i will have for e.g. 0-3 chars of each line as the first column in the csv, 4-10 chars of the line as... (3 Replies)
Discussion started by: babom
3 Replies

5. Shell Programming and Scripting

Script to generate csv file

Hello; I need to generate a csv file that contains a list of all the files in a particular server (from the root directory ie: \) that have a permission stamp of 777. I would like to create the csv so that it contains the following: server name, file name, full path name where file exists,... (17 Replies)
Discussion started by: gvolpini
17 Replies

6. Shell Programming and Scripting

Read a CSV file and generate SQL output

Friends, This is what I need: I will pass a CSV file as an input, and I want my shell to be reading that CSV file, and based on the parameters it should generate SQLs and write those SQL in a different file in the same location. I'm new to Shell scripting. I'm currently working on a... (25 Replies)
Discussion started by: Ram.Math
25 Replies

7. Shell Programming and Scripting

to read a CSV file and generate SQL output

Friends, This is what I need: I will pass a CSV file as an input, and I want my shell to be reading that CSV file, and based on the parameters it should generate SQLs and write those SQL in a different file in the same location. I'm new to Shell scripting. I'm currently working on a... (1 Reply)
Discussion started by: Ram.Math
1 Replies

8. Shell Programming and Scripting

need help in Parsing a CSV file and generate a new output file

Hi Scripting Gurus, I am trying to parse a csv file and generate a new output file. The input file will be a variable length in turns of rows and columns. output file will have 8 columns. we have three columns from the header for each set. just to give little bit more clarification each row... (15 Replies)
Discussion started by: vkr
15 Replies

9. UNIX for Dummies Questions & Answers

generate CSV file using AWK script

Hi guys I have a text report that consists of text in some parts and data in some parts. e.g Report for changes in cashflows No changes were found Report for changes in Bills deal_num deal_date trader maturity log_creator DF_234 20-5-2008 tman 20-5-2009 tman... (2 Replies)
Discussion started by: magikminox
2 Replies

10. Shell Programming and Scripting

Generate csv file

I have a file which has some thousand records in the following format File: input.txt -> <option value="14333">VISWANADH VELAMURI</option> <option value="17020">VISWANADHA RAMA KRISHNA</option> I want to generate a csv file from the above file as follows File: output.txt -> ... (4 Replies)
Discussion started by: rahulrathod
4 Replies
Login or Register to Ask a Question