Help with shell scripting for accepting .csv files as CLA


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Help with shell scripting for accepting .csv files as CLA
# 1  
Old 07-20-2010
Help with shell scripting for accepting .csv files as CLA

I want to automate test script on shell scripting.

There are 2 .csv files named account.csv and balance.csv.These files needs to passed as command line arguments and the following logic needs to applied further.

Any account with a balance that was due before Oct 23, 2007 has an overdue value of 1
Any account without an overdue balance has a NULL overdue value (empty in the csv files) or an overdue value of 0


Write an automated test script to verify that the data in the files is correct. Your script should take in 2 command line arguments - the name of the account file and the name of the balance file. The output should indicate any problem accounts and nothing for accounts that have their overdue value properly set.


Files with 2 sample accts

accounts.csv

id name date acctno overdue
1 A 9/13/2007 15.36 12345 1
2 B 11/24/2006 15.36 12346

balance.csv

id acctno balance balance_due
1 12345 482.69 11/28/2007 15.54
2 12356 226.69 10/9/2007 15.54

Thanks in advance
# 2  
Old 07-21-2010
Can you please clarify the red fields:
Code:
accounts.csv

id	name	date		(balance???!)	acctno	overdue
1	A	9/13/2007	15.36		12345	1
2	B	11/24/2006	15.36		12346

balance.csv

id	acctno	balance		(date)	        balance_due
1	12345	482.69		11/28/2007	15.54
2	12356	226.69		10/9/2007	15.54

So you dont have the account numbers at the same location (line numbers) in the both files? Is that correct?
# 3  
Old 07-21-2010
Yes the acctnos are not in same line in both the files.

i gave sample acctnos listed in the eg.

The actual acctnos are diff. u can try with diff acctno and balance. I just typed the acctnos and other fields for the structure of files

---------- Post updated at 10:09 AM ---------- Previous update was at 09:15 AM ----------

Both the files are having more than 100 records.

Thanks in advance

---------- Post updated at 03:53 PM ---------- Previous update was at 10:09 AM ----------

The application accesses these 2 tables and sets the values for overdue flag based on the logic. The application has been run and it sets the value. We are going to check in test script the values set are correct and if not the accts which are having problem has to be listed.

Thanks
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Export Oracle multiple tables to multiple csv files using UNIX shell scripting

Hello All, just wanted to export multiple tables from oracle sql using unix shell script to csv file and the below code is exporting only the first table. Can you please suggest why? or any better idea? export FILE="/abc/autom/file/geo_JOB.csv" Export= `sqlplus -s dev01/password@dEV3... (16 Replies)
Discussion started by: Hope
16 Replies

2. UNIX for Beginners Questions & Answers

Reconciling two CSV files using shell scripting

I have two CSV files file1, file2 as below File 1: Key, Value1, Value2, Value3, Value4,......value A,50,100,50,40,....,100 File 2: Key, value1,Value2,Value3,Value 4 so on... A,50,80,45,50..... Now, I want to check if key from file 1 is present in file 2 or not if present I want to... (9 Replies)
Discussion started by: hustler
9 Replies

3. Shell Programming and Scripting

Read csv file, convert the data and make one text file in UNIX shell scripting

I have input data looks like this which is a part of a csv file 7,1265,76548,"0102:04" 8,1266,76545,"0112:04" I need to make the output data should look like this and the output data will be part of text file: 7|1265000 |7654899 |A| 8|12660000 |76545999 |B| The logic behind the... (6 Replies)
Discussion started by: RJG
6 Replies

4. Shell Programming and Scripting

Need a piece of shell scripting to remove column from a csv file

Hi, I need to remove first column from a csv file and i can do this by using below command. cut -f1 -d, --complement Mytest.csv I need to implement this in shell scripting, Whenever i am using the above command alone in command line it is working fine. I have 5 files in my directory and... (3 Replies)
Discussion started by: Samah
3 Replies

5. Shell Programming and Scripting

Shell script for field wise record count for different Files .csv files

Hi, Very good wishes to all! Please help to provide the shell script for generating the record counts in filed wise from the .csv file My question: Source file: Field1 Field2 Field3 abc 12f sLm 1234 hjd 12d Hyd 34 Chn My target file should generate the .csv file with the... (14 Replies)
Discussion started by: Kirands
14 Replies

6. Shell Programming and Scripting

How to calculate average of csv using shell scripting?

Hi, I need to calculate the average of the following values using shell scripitng. Can anyone please suggest a solution? ... (10 Replies)
Discussion started by: karan pratap si
10 Replies

7. Shell Programming and Scripting

How to calculate avg values of csv file using shell scripting .?

hi all i have a reporting work and i want it to be automated using shell scripting kindly let me know how can i make that possibe . eg data are :... (2 Replies)
Discussion started by: Avinash shaw
2 Replies

8. Shell Programming and Scripting

How to create or convert to pdf files from csv files using shell script?

Hi, Can anyone help me how to convert a .csv file to a .pdf file using shell script Thanks (2 Replies)
Discussion started by: ssk250
2 Replies

9. Shell Programming and Scripting

Shell scripting:from text file to CSV

Hello friends, I have a file as follows: "empty line" content1 content2 content3 content1 content2 content3 content1 content2 content3 It starts with an empty line, how can i get a csv like this: (12 Replies)
Discussion started by: kraterions
12 Replies

10. Shell Programming and Scripting

How to insert a sequence number column inside a pipe delimited csv file using shell scripting?

Hi All, I need a shell script which could insert a sequence number column inside a dat file(pipe delimited). I have the dat file similar to the one as shown below.. |A|B|C||D|E |F|G|H||I|J |K|L|M||N|O |P|Q|R||S|T As shown above, the column 4 is currently blank and i need to insert sequence... (5 Replies)
Discussion started by: nithins007
5 Replies
Login or Register to Ask a Question