how to read dbf file in shell script and to convert dbf file usinf shell script


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting how to read dbf file in shell script and to convert dbf file usinf shell script
# 1  
Old 05-11-2009
how to read dbf file in shell script and to convert dbf file usinf shell script

Hi all,

I am new to shell scripting.
I have dbf file and I need to convert it into csv file.
OR, can i read the fields from a .dbf file and OR seprate the records in dbf file and put into .csv or txt.
Actually in the .dbf files I am getting , the numbers of fields may vary in very record and hence no of columns in the records is not fixed,,,but there is a mandatory field Name_area and rest are optionals , so is there a way to fix the end of record in a .dbf file while reading it through shell script code.

i cant use PERL or Python scripts ,I have to use korn shell scripts..

Your help will be highly appreciated..
u can respond or mail me at email removed.

Thanks in Advance...

Last edited by radoulov; 05-12-2009 at 11:20 AM.. Reason: Email removed, please read the rules!
# 2  
Old 05-11-2009
.dbf is a generic for Database File. What database engine are you running? If these are not flat files you will need a program to do the conversion to .csv.
# 3  
Old 05-11-2009
how to read dbf file in shell script and to convert dbf file usinf shell script

hey thanks methyl for your response.....

.dbf, I am getting from upstream system...so i dont know what database engine they are using ...we just recover this file ....
I have to read some information from this dbf file(NAME_AREA field basically)...and then put it into some csv file...OR alltogether convert this dbf file into csv
is it possible with programming ( korn shell scripting or UNIX c)
ar any other free library etc which can be used......

I know that this can be easily done in Windows environment..but we are using HP UNIX and shell, c programming environment.

Your any help regarding it will be highly appreciated......
# 4  
Old 05-12-2009
Ths is a non-starter without knowing what software wrote the file and in what format. Can you get the file converted at source?
# 5  
Old 05-12-2009
can I send u the file ?? ..may be u get some clue...as I dont hve idea abt databases so I have never dealt with diff. file formats and all.....
is thr a way to send u this file..!!!!!
# 6  
Old 05-12-2009
Sorry cannot oblige. An isolated .dbf file is unlikely to be useful without the matching software.
# 7  
Old 05-12-2009
ok...neways ..thanx methyl..
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Shell Script to Read the given file contents into a merged one file

Like to have shell script to Read the given file contents into a merged one file with header of path+file name followed by file contents into a single output file. While reading and merging the file contents into a single file, Like to keep the format of the source file. ... (4 Replies)
Discussion started by: Siva SQL
4 Replies

2. 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

3. Shell Programming and Scripting

Need help to write a shell script to convert text file to excel file.

Hi Everyone, I want your help to write a script which will take text file as input and on the basis of delimiter ":"script will create excel sheet. Example input: IpAdress:InstanceName:Port:ServerName 10.255.255.1:abc:2232:xyz_abc Output should be an excel sheet like below: Column... (8 Replies)
Discussion started by: akabhinav18
8 Replies

4. UNIX for Dummies Questions & Answers

Shell script to read lines in a text file and filter user data Shell Programming and Scripting

sxsaaas (3 Replies)
Discussion started by: VikrantD
3 Replies

5. UNIX for Dummies Questions & Answers

ArcGIS shapefile *.dbf file to ascii text

Okay, I search around and couldn't find what I needed, so here goes: I have a series of ArcGIS point shapefiles. If I open them in Excel I can save as an Excel or text file and get a 2 column list: POINTID | GRID_CODE 1 | 2.34234 2 | 4.3425 3 | 6.32456 etc... The problem is that I... (3 Replies)
Discussion started by: jbrandt1979
3 Replies

6. Shell Programming and Scripting

Convert excel file to PDF file using shell script

Hi All, Is it possible to convert the excel file to PDF file(Without loosing any format) using unix shell scripting ??? If yes Kindly help me on the code Thanks in advance!!! (5 Replies)
Discussion started by: Balasankar
5 Replies

7. Shell Programming and Scripting

Convert XML to Data File in Shell Script

Hi All, I will be getting a huge XML file with a lot of records in it. I need to convert it into multiple data files. SAMPLE XML FILE <ABSProductCatalog xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> - <ProductSalesHierachy> - <Portfolios> - <Portfolio productCode="P1"> ... (8 Replies)
Discussion started by: ragha81
8 Replies

8. Shell Programming and Scripting

Need shell script to read two file at same time and print out in single file

Need shell script to read two file at same time and print output in single file Example I have two files 1) file1.txt 2) file2.txt File1.txt contains Aaa Bbb Ccc Ddd Eee Fff File2.txt contains Zzz Yyy Xxx (10 Replies)
Discussion started by: sreedhargouda
10 Replies

9. Shell Programming and Scripting

How to FTP file usinf shell script to Mainframes

Hi , Please help me FTP an output file to mainframes using Mainframes. I have no idea how to FTP to mainframes. :( I need to deploy my code by next week. The code is ready but the client's requirement is that i need to ftp all the output file to the mainframes server. I created the dataset... (1 Reply)
Discussion started by: deepthimathew
1 Replies
Login or Register to Ask a Question