02-15-2005
Quote:
Originally Posted by Laud12345
The reason I cannot use a comma as a delimiter or anything like that is because the fields are not seperated by a delimiter, but allocated a certain number of bytes.
For example:
Firstname (10) Last Name (10)
MickelsonJackonson ( You will have fields that take up all space in the field and you won't have any commas in there)
I am thinking of using the substr function from awk which will be able to read in the exact bytes from each line and then put it into an array or something to process it.
if your "fields" are of
fixed width you can take advantage of gawk's "FIELDWIDTH" internal variable for processing.
If you don't have gawk installed on your system, take a look at this thread at comp.lang.awk how to "simulate" FIELDWIDTH in other awks:
FIELDWIDTH
9 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
If someone out there could help me out with this problem. I would really appreciate it.
I am trying to convert xml into text file(fixed length) using Unix Borne shell scripts.
My xml file:
<root>
<header_rec recordtype="00">
<record_id>00</record_id>
<country_code>AK></country_code>... (0 Replies)
Discussion started by: ram2s2001
0 Replies
2. Windows & DOS: Issues & Discussions
Is there a tool available to convert UNIX (BASH Shell) scripts to DOS scripts?
I understand that DOS scripting is far inferior to unix scripting, and therfore this conversion may not be possible.
Alternativley, perhaps I could convert my Unix scripts to C... then compile it for a windows... (2 Replies)
Discussion started by: Crozz
2 Replies
3. Shell Programming and Scripting
Hi All,
I am very new to this forum and beginner to shell scripting.
I need a shell script to:
Search for a text in XML file à if the same text appears twice in an XML file à output file name
Script should loop thru every xml file of a given folder.
Please help me writing this script.
... (1 Reply)
Discussion started by: amardeep001
1 Replies
4. UNIX for Dummies Questions & Answers
Hi,
I am new to shell scripting and exploring it , I have developed few sample shell script but I have developed them on windows xp notepad and then saving them on folder and then testing them on cywgin and running perfectly...but these scripts are in dos format and I want to convert them in unix... (1 Reply)
Discussion started by: rahul125
1 Replies
5. Shell Programming and Scripting
Hi folks,
Need some help with XML to text file parsing , the following is the content of the XML File.
<xn:SubNetwork id="SNJNPRZDCR0R03">
<xn:MeContext id="PRSJU0005">
<xn:VsDataContainer id="PRSJU0005">
<xn:attributes>
... (6 Replies)
Discussion started by: tech_frk
6 Replies
6. Shell Programming and Scripting
Hi Friends,
I want to convert a XML file to flat file.
Sample I/p:
<?xml version='1.0' encoding='UTF-8' ?>
<DataFile xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' contactCount='4999' date='2012-04-14' time='22:00:14' xsi:noNamespaceSchemaLocation='gen
.xsd'>
<Contact... (3 Replies)
Discussion started by: karumudi7
3 Replies
7. Solaris
Hi,
I want to parse an XML File using Shell Script preferably by using awk command,
I/P file is :
<gn:ExternalGsmCell id="016P3A">
<gn:attributes>
<gn:mnc>410</gn:mnc>
<gn:mcc>310</gn:mcc>
<gn:lac>8016</gn:lac>
... (2 Replies)
Discussion started by: tech_frk
2 Replies
8. UNIX for Dummies Questions & Answers
hi guys, i want help... Reding XML file and print the values into the text file using linux shell script file as per below xml file
<sequence>
<Filename>aldorzum.doc</Filename>
<DivisionCode>US</DivisionCode>
<ContentType>Template</ContentType>
<ProductCode>VIMZIM</ProductCode>
</sequence>... (1 Reply)
Discussion started by: sravanreddy
1 Replies
9. Programming
Hello Team,
I have 2 files.one contains english text and another contains Japanese. so i have to read english text and replace the text with Japanesh text in third file.
Basically, I need a help to write japanese language in text/xml file.I heard wstring does this.Not sure how do i write... (2 Replies)
Discussion started by: SA_Palani
2 Replies
LEARN ABOUT DEBIAN
dbview
DBVIEW(1) Database Management DBVIEW(1)
NAME
dbview - View dBase III files
SYNOPSIS
dbview [-b|--browse] [-d delim| --delimiter delim] [-D|--deleted] [-e|--description] [-h|--help] [-i|--info] [-o|--omit] [-v|--version]
[-r|--reserve] [-t|--trim] dbfile
DESCRIPTION
Dbview is a little tool that will display dBase III files. You can also use it to convert your old .dbf files for further use with Unix.
It should also work with dBase IV files, but this is mostly untested.
By default dbview displays the contents of a dBase III or IV database file. This is be done by displaying both the name of the field
itself and its value. At the end of every record a newline is appended.
OPTIONS
If no option given dbview only displays the database in its most friendly way.
--browse, -b
switches into browse mode. Using this mode no fieldnames will be displayed, instead every record will displayed in one line using a
delimiter to separate fields.
--delimiter, -d delimiter
The default delimiter in browse mode is the colon sign ``:''. This parameter overrides it. This can be useful especially if you
plan to examine the output with scripts.
--deleted, -D
displays deleted records as well as the delete state in each record in the database.
--description, -e
displays the field description of the database.
--help, -h
displays a complete (or short) help screen.
--info, -i
displays some (partially technical) information about the database like number of records and length of each record.
--omit, -o
omits displaying the whole database. Using this parameter can be useful if you're only interested in the structure.
--reserve, -r
Normally fieldnames are converted into a more friendly format. They are stored in capital letters, but that looks like shouting.
This parameter supresses the conversion.
--trim, -t
When this option is specified, leading and trailing spaces are omitted. This might be useful when in browse mode.
--version, -v
displays version and exits.
NOTES
As dBase is DOS, umlauts are stored using a different code table (namely ASCII) than most modern unices (namely ANSI). If you encounter
such a file, I would recommend piping the output through recode(1) with ibmpc:latin1 as it's argument.
If you want to examine the output generated by the browse mode, just take cut(1) and set its delimiter to the used delimiter or take awk(1)
and continue.
COPYRIGHT
Dbview is free software. It is based on routines from unknown source that I found on nic.funet.fi in /pub/msdos/languages/c as dbase.c.
The file contained the following notice:
These functions are provided by Valour Software as a gift.
I have modified and included this file and wrote a skeleton around it. All together provides a powerful tool for dBase III and IV database
manipulation under Unix.
I mainly have written this program, because I've got several dbase files containing important information for me. As I won't go running
DOS everytime I need some of the stored information, I had to find a viewer that runs unter Unix, resp. Linux, but unfortunately didn't
find one. So it was my turn.
This package as a whole is published under the GNU Public License, which is a great invention.
It wasn't the intention to write a freaking viewer and reinvent the wheel again. Instead dbview is intend to be used in conjunction with
your favourite unix text utilities like cut, recode and more.
Martin Schulze
Infodrom Oldenburg
joey@infodrom.north.de
SEE ALSO
recode(1), more(1), awk(1), cut(1).
Unix November 20th, 2006 DBVIEW(1)