08-06-2008
Am I reading your sample right?
It looks like each of the first three records will have slightly different rules.
(1) has 1230-1630 as field
(2) does not have this field
(3) creates this field by splitting off the previous field
rec (4) appears like rec (2)
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Is there a command that sets a variable length?
I have a input of a variable length field but my output for that field needs to be set to 32 char.
Is there such a command?
I am on a sun box running ksh
Thanks (2 Replies)
Discussion started by: r1500
2 Replies
2. Shell Programming and Scripting
Hi, I have to change a tab delimited file to a fixed length file. For text fields I need to left justify and NULL fill to the right and for number fields I need to right justify and zero fill to the left. If there are spaces between words in a text field I need to keep them as spaces. I am using... (14 Replies)
Discussion started by: nelson553011
14 Replies
3. 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>
... (0 Replies)
Discussion started by: ram2s2001
0 Replies
4. Shell Programming and Scripting
I have below fixed lenth file . I have to convert this to delimitted file.
File1.txtE116005/29/19930E001E000
E12201/23/19940E001E003
E10406/4/19940E001E003
I want to convert this to :
E116,0,05/29/1993,0,E001,E000
E122,0,1/23/1994,0,E001,E003
E104,0,6/4/1994,0,E001,E003
I have a... (7 Replies)
Discussion started by: satyam_sat
7 Replies
5. UNIX for Dummies Questions & Answers
I want to find out the record length of a fixed length file? I forgot the command. Any body know? (9 Replies)
Discussion started by: tranq01
9 Replies
6. UNIX for Dummies Questions & Answers
Hi, all.
I need to convert a file tab delimited/variable length file in AIX to a fixed lenght file delimited by spaces. This is the input file:
10200002<tab>US$ COM<tab>16/12/2008<tab>2,3775<tab>2,3783
19300978<tab>EURO<tab>16/12/2008<tab>3,28523<tab>3,28657
And this is the expected... (2 Replies)
Discussion started by: Everton_Silveir
2 Replies
7. Shell Programming and Scripting
I have a 1250 byte record that I need to sort in column 10-19 and in column 301. I have tried the sort command, but it looks like it needs delimiters to work. The record can have spaces in a lot of its 1250 columns, but 10-19, and 301 are guaranteed. These columns are numeric too.
A sample... (1 Reply)
Discussion started by: mb1201
1 Replies
8. Shell Programming and Scripting
Hi Gurus,
Thanks in advance...
I am new to writing shell scripting and help me out reading a flat file with fixed length.
I have a fixed length flat file with storename(lenth 6) , emailaddress(lenth 15), location(10). There is NO delimiters in that file.
Like the following str00001.txt... (2 Replies)
Discussion started by: willywilly
2 Replies
9. UNIX for Dummies Questions & Answers
I have a fixed width file of length 53. when is try to get the lengh of the record of that file i get 2 different answers.
awk '{print length;exit}' <File_name>
The above code gives me length 50.
wc -L <File_name>
The above code gives me length 53.
Please clarify on... (2 Replies)
Discussion started by: Amrutha24
2 Replies
10. Shell Programming and Scripting
Hi Team,
I have an issue to split the file which is having special chracter(German Char) using awk command.
I have a different length records in a file. I am separating the files based on the length using awk command.
The command is working fine if the record is not having any... (7 Replies)
Discussion started by: Anthuvan
7 Replies
LEARN ABOUT PHP
px_create_fp
PX_CREATE_FP(3) PX_CREATE_FP(3)
px_create_fp - Create a new paradox database
SYNOPSIS
bool px_create_fp (resource $pxdoc, resource $file, array $fielddesc)
DESCRIPTION
Create a new paradox database file. The actual file has to be opened before with fopen(3). Make sure the file is writable.
Note
Calling this functions issues a warning about an empty tablename which can be safely ignored. Just set the tablename afterwards with
px_set_parameter(3).
Note
This function is highly experimental, due to insufficient documentation of the paradox file format. Database files created with this
function can be opened by px_open_fp(3) and has been successfully opened by the Paradox software, but your milage may vary.
PARAMETERS
o $pxdoc
- Resource identifier of the paradox database as returned by px_new(3).
o $file
-File handle as returned by fopen(3).
o $fielddesc
- fielddesc is an array containing one element for each field specification. A field specification is an array itself with either
two or three elements.The first element is always a string value used as the name of the field. It may not be larger than ten
characters. The second element contains the field type which is one of the constants listed in the table Constants for field
types. In the case of a character field or bcd field, you will have to provide a third element specifying the length respectively
the precesion of the field. If your field specification contains blob fields, you will have to make sure to either make the field
large enough for all field values to fit or specify a blob file with px_set_blob_file(3) for storing the blobs. If this is not
done the field data is truncated.
RETURN VALUES
Returns TRUE on success or FALSE on failure.
EXAMPLES
Example #1
Creating a Paradox database with two fields
<?php
if(!$pxdoc = px_new()) {
/* Error handling */
}
$fp = fopen("test.db", "w+");
$fields = array(array("col1", "S"), array("col2", "I"));
if(!px_create_fp($pxdoc, $fp, $fields)) {
/* Error handling */
}
px_set_parameter($pxdoc, "tablename", "testtable");
for($i=-50; $i<50; $i++) {
$rec = array($i, -$i);
px_put_record($pxdoc, $rec);
}
px_close($pxdoc);
px_delete($pxdoc);
fclose($fp);
?>
SEE ALSO
px_new(3), px_put_record(3), fopen(3).
PHP Documentation Group PX_CREATE_FP(3)