Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Parsing a variable length record Post 56132 by Barb on Tuesday 28th of September 2004 11:18:43 AM
Old 09-28-2004
Here is the actual sample - whoops
Code:
   ~REF^BO^C61102^BIN LOCATION~PO1^29^6.00^PK^9.50^^VC^435916^IN^916~PID^F^^^^PAD, DRI FLOW (12/PK 6PK/CS)~ACK^AC^6.00^PK~REF^
AP^C400=PK   ^          ~REF^BO^C61102^BIN LOCATION~CTT^29^334.00~SE^139^0001~GE^1^5644~IEA^1^000005701~@@@@@@@@@@@@@@@@@@@@@@@@
ISA^00^D011-56018^00^VAX-VMSSYS^01^GENERAL MEDICAL^ZZ^011            ^040506^1702^U^00200^000005702^0^P^|~GS^PR^GM^56018^040506^
1702^5645^X^003020~ST^855^0001~BAK^06^AC^440597^040506^^^^^040506~REF^IV^723065~DTM^055^040506^1703~PER^BD^JANET ARROYO~N1^ST^^9
1^573~N1^BT^0100^91^56018~PO1^1^12.00^BX^7.39^^VC^213458^IN^15074~PID^F^^^^ELECTRODE, EKG INSTATRACE 5'S (50/BX)~ACK^AC^12.00^BX
~REF^AP^C72=BX    ^          ~REF^BO^C61802^BIN LOCATION~CTT^1^12.00~SE^14^0001~ST^855^0002~BAK^06^AC^440598^040506^^^^^040506~R
EF^IV^723066~DTM^055^040506^1703~PER^BD^SAE JACKSON~N1^ST^^91^657~N1^BT^0100^91^56018~PO1^1^12.00^EA^0.28^^VC^278487^IN^1207~PID
^F^^^^BATTERY, ALKALINE "AAA" (24/BX 3BX/CS)~ACK^AC^12.00^EA~REF^AP^C60=BX    ^          ~REF^BO^C61202^BIN LOCATION~PO1^2^24.00
^EA^0.47^^VC^278484^IN^127~PID^F^^^^BATTERY, ALKAL "C" (SPEC) (12/BX 6BX/CS)~ACK^AC^24.00^EA~REF^AP^C100=BX   ^          ~REF^BO
^C61802^BIN LOCATION~PO1^3^48.00^EA^0.25^^VC^278485^IN^130~PID^F^^^^BATTERY, ALKAL "AA" (24/BX 6BX/CS)~ACK^AC^48.00^EA~REF^AP^C3
02=BX   ^          ~REF^BO^C61902^BIN LOCATION~PO1^4^6.00^EA^0.58^^VC^186661^IN^780~PID^F^^^^SOD CHL, IVSOL 0.9% 500ML (24/CS)~A
CK^AC^6.00^EA~REF^AP^C305=CS   ^          ~REF^BO^C61102^BIN LOCATION~CTT^4^90.00~SE^29^0002~GE^2^5645~IEA^1^000005702~@@@@@@@@@
ISA^00^D011-56018^00^VAX-VMSSYS^01^GENERAL MEDICAL^ZZ^011            ^040506^1801^U^00200^000005703^0^P^|~GS^PR^GM^56018^040506^
1801^5646^X^003020~ST^855^0001~BAK^06^AC^440601^040506^^^^^040506~REF^IV^723079~DTM^055^040506^1803~PER^BD^SCOTT FITZGERALD~N1^S
T^^91^609~N1^BT^0100^91^56018~PO1^1^15.00^EA^6.08^^VC^405660^IN^14789~PID^F^^^^C


Last edited by Perderabo; 09-29-2004 at 01:00 PM..
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Parsing data and retaining the full length of variable

Here's is an example of what I want to do: var1="Horse " var2="Cat " var3="Fish " for animals in "$var1" "$var2" "$var3" do set $animals pet=$1 ## Ok, now I want to get the values of $pet, but ## I want to retain the full length it was... (3 Replies)
Discussion started by: app4dxh
3 Replies

2. Shell Programming and Scripting

creating a fixed length output from a variable length input

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

3. Shell Programming and Scripting

Pivot variable record length file and change delimiter

Hi experts. I got a file (500mb max) and need to pivot it (loading into ORCL) and change BLANK delimiter to PIPE |. Sometimes there are multipel BLANKS (as a particular value may be BLANK, or simply two BLANKS instead of one BLANK). thanks for your input! Cheers, Layout... (3 Replies)
Discussion started by: thomasr
3 Replies

4. UNIX for Dummies Questions & Answers

What the command to find out the record length of a fixed length file?

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

5. Shell Programming and Scripting

Parsing a variable length file

Hi I am new to shell scripting. I need to parse a file which contains the header and detail records and split into n of file based on dept ID, for ex. INPUT FILE: DEPT ID: 1 EMPNAME: XYZ EMPAddress: XYZZZ DEPT ID: 2 EMPNAME: ABC EMPAddress: ABCD DEPT ID: 1 EMPNAME: PQR EMPAddress:... (6 Replies)
Discussion started by: singhald
6 Replies

6. Shell Programming and Scripting

Check length of record

Hi, I have a problem, please help me, I have a flat file like this: P00000000088888888999999999 0000999903 000000000000000000 P00000000077777777000000000 0000999903 000000000000000000 P00000000044444444333333333 0000999903 00000000000000000079875 P00000000066666666111111111 0000999903 ... (5 Replies)
Discussion started by: DebianJ
5 Replies

7. Shell Programming and Scripting

Make variable length record a fixed length

Very, very new to unix scripting and have a unique situation. I have a file of records that contain 3 records types: (H)eader Records (D)etail Records (T)railer Records The Detail records are 82 bytes in length which is perfect. The Header and Trailer records sometimes are 82 bytes in... (3 Replies)
Discussion started by: jclanc8
3 Replies

8. Shell Programming and Scripting

changing a variable length text to a fixed length

Hi, Can anyone help with a effective solution ? I need to change a variable length text field (between 1 - 18 characters) to a fixed length text of 18 characters with the unused portion, at the end, filled with spaces. The text field is actually field 10 of a .csv file however I could cut... (7 Replies)
Discussion started by: dc18
7 Replies

9. Shell Programming and Scripting

Record length

Hi, The record length may be differ in afile. I want to display the records if the record length is not equal to 50 using sed/awk command. Thanks in Advance (6 Replies)
Discussion started by: NareshN
6 Replies

10. Shell Programming and Scripting

Convert variable length record to fixed length

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
PX_PUT_DATA_ALPHA(3)					     Library Functions Manual					      PX_PUT_DATA_ALPHA(3)

NAME
PX_put_data_alpha -- Put value into an alpha data field SYNOPSIS
#include <paradox.h> void PX_put_data_alpha(pxdoc_t *pxdoc, char *data, int len, char *value) DESCRIPTION
Converts a string into a value for a data field as it stored in the database file. You must set the target encoding before in order to recode the string. If you do not set the encoding the data will be stored as is. You should use this function instead of accessing the record data directly. data points to the start of the data field in the record. It must be calculated by summing up all field length before the field to operate on and add it to the base pointer of the record. SEE ALSO
PX_put_data_long(3), PX_put_data_double(3), PX_put_data_short(3), PX_put_data_byte(3), PX_put_data_bytes(3) AUTHOR
This manual page was written by Uwe Steinmann uwe@steinmann.cx. PX_PUT_DATA_ALPHA(3)
All times are GMT -4. The time now is 08:13 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy