Sponsored Content
Full Discussion: EDI File Parser
Top Forums Shell Programming and Scripting EDI File Parser Post 302932824 by ashokv3 on Sunday 25th of January 2015 05:44:34 AM
Old 01-25-2015
gawk on Windows 7 Enterprise edition.

I get error while using if statement also.

$100 is to assign NULL values. I forgot to add command to replace '~' which is not a priority.

Simple explanation of my code:

Code:
/^CLM/ {CLM_NBR = $2}

If a line begins with CLM, assign second field value to CLM_NBR.

Code:
/^CLM/ {split($6,x,">");(x[3]=="7"||x[3]=="8")? (/^REF\*F8/ {REP_CLM = $3;REF_QUAL = $2}) : {REP_CLM = $100;REF_QUAL = $100}}

For record starting with CLM, 6th field is again delimited by ">". 6th column is splitted and value is held in an array x. If x[3] is either 7 or 8, then consider the line starting with REF*F8.

Once DTP line is encountered, print all the value stored in the variables.

Thanks.
Ashok
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Help with an (easy) parser

Hello, i'm workig with a file with structural information about biological macromolecules (proteins etc). In a certain file, the info is structured like this @<TRIPOS>MOLECULE blah 1 blah 2 blah 3 @<TRIPOS>MOLECULE foo 1 foo 2 foo 3 @<TRIPOS>MOLECULE mmm 1 mmm 2 mmm 3 I would... (7 Replies)
Discussion started by: aristegui
7 Replies

2. Shell Programming and Scripting

need a text parser

i need a simple text parser which can parse a data file created by a softwre so that i can export it to my mysqldb,, datafile created as one record per line with different number of fields. e.g datafile contains following. a=1, b=3, c=4 a=1, c=55, d=abcd a=5, b=hello, c=99, d=help now i... (12 Replies)
Discussion started by: sfaizan
12 Replies

3. Shell Programming and Scripting

How to Strip lines off Streamed EDI Output

Attached is a streamed EDI ANSI X12 output where the segment terminator/delimiter is a tilde ~ character. Is it possible to do the following pseudo-code in a unix script (using either sed, awk and/or grep)? Open file StreamedOutput.txt Search for ISA and delete the data up to the tilde ~ char... (7 Replies)
Discussion started by: sapedi
7 Replies

4. Shell Programming and Scripting

Compare EDI files by skipping selected Segments

Hi, I wanted to compare EDI files present in Two different Directories which can be related by the file names. While comparing the EDI files i have to skip selected segments such as "ISA" "IEA" and "GS" "GE" since this may have datetime stamp and different "Sender" "Receiver" Qual. and... (3 Replies)
Discussion started by: Sivas
3 Replies

5. Shell Programming and Scripting

parsing issue with edi file

Hello, We have edi files we need to do some extra parsing on. There is a line that shows up that looks like this: GE|8,845|000000000 We need to parse the file, find the line ( that begins with GE "^GE" ), and remove the comma(s). What is the easiest way to do that ? I know I can grab... (5 Replies)
Discussion started by: fwellers
5 Replies

6. SCO

Add memory and EDI hard disk space

Dear all I would like to know if you have face to the problems as add 1. 256 MB DDR Ram memory 2. IDE 40 GB slaved hard-disk my current machine is GA-SIML Rev 1.0, 1.6 GHz CPU, 1GB HDD, 256 MB DDR-Ram memory, as I add another 256 DDR-Ram, and 40 GB Slaved EDI Hard disk it, the systems... (1 Reply)
Discussion started by: TinhNhi
1 Replies

7. Programming

Parser

Hi Everyone I have an out put of multiple lines which I would like to parse and retrieve certain info from it. The output consists of multiple sections that starts with the line Client: and ends with STL tag: each section separated by an empty line. So basically somehting like Client: ... (10 Replies)
Discussion started by: bombcan1
10 Replies

8. Shell Programming and Scripting

File Parser

Hi need help parsing a file. I have tag fields and values in a file with delimiter |. sample records from the file listed below 8=value|9=value|35=value|49=value|56=value|34=value|50=value|48=value|10=value 8=value|9=value|35=value|49=value|56=value|34=value|51=value|48=value|10=value... (2 Replies)
Discussion started by: subramanian
2 Replies

9. Shell Programming and Scripting

Parser

Hi All, I am trying to create a parser to find out what cobol programs are being called by which JCL's. I need to search recursively until the main cobol program is found being called by a JCL. I tried to create a script but I am not able to generalize it. Can someone please help. ... (1 Reply)
Discussion started by: nua7
1 Replies

10. Shell Programming and Scripting

A Stanza File Parser in Pure ksh

As it was ultimately Don Craguns idea that saved the whole project i can as well give something back to the community. This is my stanza file parser, which was written only using ksh without any external programs. The stanza structure There is some inconsistency as to what exactly is meant by... (0 Replies)
Discussion started by: bakunin
0 Replies
parconfig(1M)															     parconfig(1M)

NAME
parconfig - provides a recommended nPartition configuration SYNOPSIS
mode] policy] PartitionNumber] [celltype]use_on_next_boot]failure_usage] N | N | N } DESCRIPTION
is an advisory command. The command runs a set of the Locality-Optimized Resource Alignment (LORA) rules and provides recommended configu- ration of the nPartition. See lora(7) for information about Locality-Optimized Resource Alignment. By default gives advice in the form of a command for the new local partition and the advice is displayed on the standard output. The option can be specified to get advice in the form of a command for an existing partition. Either the or option can be specified to get the advice for the specified target (local or remote) complex. The resulting advice in the form of or command can be redirected to a text file; the user can then modify the command if needed and explicitly execute the command to create new recommended nPartition or to modify an existing nPartition. Superuser permission is required to run this command on the local partition. If the or option is used to access a remote partition or com- plex; superuser permission is not required on the local system, and the local system need not exist on an nPartition. If the option is specified, username on the remote host must have superuser permission or the command will fail. Please refer to the for a description of the partition management terms used in this man page. Options and Arguments recognizes the following command line options and arguments: Identifies a cell to be assigned to the partition. To assign multiple cells to the partition, multiple options should be used. cell specifies the cell ID. It can be specified either in the local (cabinet#/slot#) or global (cell#) format. For example, the cell located in cabinet 0, slot 1 is identified in the local format as 0/1 or in the global format as 1. celltype specifies the type of the cell. The valid celltype values for a cell are: A base cell in a partition participates in interleaved memory. A floating cell in a partition does not participate in interleaved memory (all of the cell's memory is used as CLM). Note: If no celltype is specified, policy rules (specified through the option) will be applied to the cell to determine the type of the cell. use_on_next_boot specifies whether the cell will participate in a reboot. The valid values for use_on_next_boot are: participate in reboot. This is the default. However if the slot is missing or the cell does not exist or the cell is powered off then it defaults to do not participate in reboot. failure_usage field is used by system firmware when a partition is booted. If a CPU selftest failure or a DIMM deallocation occurs during the power-on self-test process, then this flag is used by the system firmware to determine whether or not and how the cell should be integrated into the partition at boot time. The valid failure_usage values for a cell are: reactivate with memory interleave. Specifies to integrate the cell as it would normally be integrated. This is the default for base cells. this is the default value for floating cells. If the user specifies ri for a floating cell, the command displays an error and exits. deconfigure. no interleave. clm_value specifies the amount of the memory that will be configured as local (non-interleaved) memory for the cell. The command will issue a warning if the specified clm_value exceeds the total memory of the cell. Note: On PA-RISC platforms, the amount of memory allocated for CLM may not match the amount of CLM requested due to some memory being reserved exclusively by the operating system. If no clm_value is specified, policy rules (specified through option) will be applied to the cell to determine the amount of Inter- leaved memory and Local Memory for the cell. The command will issue a warning if 100% CLM is specified for all the cells in the partition. The clm_value can be expressed in two forms: o As a percentage (ratio). The percent number can be any number in the range 0 - 100 with a suffix of This number will be rounded up to 12.5%, 25%, 37.5%, 50%, 62.5%, 75%, 87% or 100%. If the cell contains less than 4 GB memory, then the percentage will be rounded to 25%, 50%, 75% or 100%. The specified percentage is applied each time the partition boots, thus resulting in a different value if the working memory in the cell is different. For example, a cell in a partition has 8 GB memory and the user specifies 50% CLM. When the partition boots, 4 GB of that cell's memory will be used as CLM. Later the user shuts down the partition, adds another 8 GB mem- ory to that cell. When the partition is booted again, the cell now has 16 GB of memory, so 8 GB (50%) is allocated as CLM. o As an absolute number (default). This can also be optionally suffixed by "GB". The clm_value is interpreted as an absolute number of gigabytes of memory. Num- bers other than integers and halves are rounded up to the nearest 0.5 GB. For example, 2.5 GB will not be rounded up. However 2.3 GB will be rounded up to 2.5 GB. For example, a cell in a partition has 8 GB memory and the user specifies 4 GB CLM. When the partition boots 4 GB of that cell's memory will be used as CLM. Later the user shuts down the partition, adds another 8 GB memory to that cell. When the partition is booted again, the cell now has 16 GB of memory, but the CLM is still 4 GB. Note: The optional cell attribute celltype and/or clm_value, if specified, should be in line with the policy rules (specified through the option). Allows access to the complex specified by the option. The accessed complex is then considered the target complex. Access is through the service processor's LAN port. The option is required if is used. If the option is specified, the command prompts for the password. If an error is reported when you attempt to connect using this option, check to see that IPMI LAN access has not been disabled on the remote service processor. Access to the complex through IPMI over LAN can be enabled or disabled by logging on to the service processor and using the command from the Command Menu. The and options are mutually exclusive. This option should only be used in combination with either the or option. IPaddress|hostname specifies the IP address or hostname, respectively, of the target partition or complex At least one of the following option must be specified: Specifies the minimum number of CPUs to be present in the partition. keyword indicates that the command will select cells such that the partition has at least N number of CPUs. N specifies the minimum number of CPUs and does not take into account the CPUs attached to the cell specified through the option. Note: The keyword can be specified only once and is mutually exclusive with the keyword. Specifies the minimum amount of memory to be present in the partition. keyword indicates that the command will select cells such that the partition has at least N GB amount of memory. N specifies the minimum amount of memory and does not take into account the memory attached to the cell specified through the option. The amount of memory can be optionally suffixed by "GB". Note: The keyword can be specified only once and is mutually exclusive with the keyword. Specifies both the minimum number of CPUs and the minimum amount of memory to be present in the partition. Specifies the number of cells to be present in the partition. keyword indicates that the command will select specific number of cells. N specifies the number of cells and does not take into account the cells specified through the option. Note: The keyword can be specified only once and is mutually exclusive with keywords and Specifies the name and configuration type of the operating system running on the local partition or target partition option specified). The valid values for OSname are: HP-UX is the operating system name and 11iV3 is the operating system configuration type. Note: Currently, the command is supported only on HP-UX 11iV3. Specifies the partition to be modified. PartitionNumber specifies the unique number (integer) assigned to the partition when it was created. Note: By default, the core cell of the partition will be retained back in the recommended configuration of the partition and the other cells might be deleted. If you wish to retain back other cells of the partition, use the option for each cell that has to be retained. Specifies the required authorization to access a partition other than the local system (but can also be used as a loopback access to the local partition). The option is required if is used. The colon is optional and is present for Linux compatibility reasons. If the option is specified, the command prompts for the password. username specifies a configured user name on the target partition. Note: This command is a Web-Based Enterprise Management (WBEM) Client Application. The option accesses the target partition using a Secure Sockets Layer (SSL) connection. If errors are reported, check that the conditions described in the section are satisfied. Specifies the mode for configuring the memory of the cell as Cell Local Memory and Interleaved Memory. The valid values for mode are: The memory of the cell is configured as a mix of Cell Local Memory and Interleaved Memory. The exact mix and layout is determined by the option. This is the default. All of the cell's memory is configured as Interleaved Memory (no clm). Specifies the resulting or command to be executed. Note: If option is not specified, by default the command displays the or command on the standard output. You can capture the com- mand displayed on standard output, edit the command if needed and explicitly execute it. Specifies the policy for determining type of the cell. This option should only be used in combination with option and mode value as The valid values for policy are: 75% of the cells are assigned base and remaining 25% of the cells are assigned float as the cell type. This is the default. All the cells are assigned base as the cell type. 25% of the cells are assigned base and remaining 75% of cells are assigned float as the cell type. A base cell in the partition participates in Interleaved Memory. 87.5% (7/8) of the base cell's memory is used as CLM. A float cell in the partition does not participate in interleaved memory. All of the float cell's memory is used as CLM. Mapping of Global Cell Numbers to Local Cell Numbers The cabinets in a complex are numbered starting from 0. The cell slots in each cabinet are also numbered starting from 0. Each cabinet can have a maximum of 8 cells. For example, the cells located in cabinet 0 will have the following cell numbers in global format: 0, 1, 2, 3, 4, 5, 6, 7. The cell num- bers in corresponding local format will be 0/0, 0/1, 0/2, 0/3, 0/4, 0/5, 0/6, 0/7. Similarly the cells located in cabinet 1 will have the following cell numbers in global format: 8, 9, 10, 11, 12, 13, 14, 15. The cell numbers in corresponding local format will be 1/0, 1/1, 1/2, 1/3, 1/4, 1/5, 1/6, 1/7. From the above convention the cell located in cabinet 1, slot 0 is identified in the local format as 1/0 or in the global format as 8. The command displays the above cell as "cab1,cell0". The cell located in cabinet 1, slot 4 is identified in the local format as 1/4 or in the global format as 12. The command displays the above cell as "cab1,cell4". See parstatus(1). RETURN VALUE
The command exits with one of the following values: Successful completion. Error condition occurred. EXAMPLES
Get a recommended configuration for the new local nPartition. Cells of the new partition should be cells with no CLM. A cell located in cabinet 0, slot 0 is a core capable cell and should be included in the new partition. The partition should have at least 8 CPUs (excluding CPUs attached to the cells specified through the option). Cell located in cabinet 0, slot 1 is free and has 8 CPUs, the output of the command will be: Get a recommended configuration for existing local nPartition. An existing partition 0 has to be modified. A cell is located in cabinet 0, slot 1 and belongs to partition 0, has to be retained back in the recommended configuration of the partition with celltype as Another cell is located in cabinet 0, slot 6 belongs to partition 0 with just 1 CPU. There should be 5 cells (except the one specified through option) in the recommended configuration of the partition. By default, the core cell of partition 0 will be retained back in the recommended configuration of the partition. Assuming cell located in cabinet 0, slot 0 is core cell of partition 0 and cells located in cabinet 0 at slot 2,3,4,5 are free, the output of the command will be: Get a recommended configuration for existing local nPartition. An existing partition 1 has to be modified. Cells in the recommended con- figuration of the partition should have at least 16 CPUs and 64GB memory. Cell type should be for both the cells. By default, the core cell of partition 1 will be retained back in the recommended configuration of the partition. Cell located in cabinet 0, slot 0 is the core cell of partition 1 and has 8 CPUs, 32GB memory. Another cell located in cabinet 0, slot 1 has 8 CPUs and 32GB mem- ory. The output of the command will be: DEPENDENCIES
This command uses the Web-Based Enterprise Management (WBEM) product and some of its configuration settings. If you encounter connection errors when using the option, check that the following two conditions are satisfied: o Use the command (see cimconfig(1M) in the WBEM product documentation) to verify (and correct if necessary) the setting of the following two variables: o o o The target partition's digital certificate has been appended to the local partition's Shared Authentication Store. For the nPartition commands, the Shared Authentication Store is stored in the file: This file is used by all the clients, which use SSL based certificates. If these clients trust a target partition, then the nPartition commands will also trust the target partition. Refer to the WBEM documents specified in the section below for further information. AUTHOR
was developed by the Hewlett-Packard Company. SEE ALSO
fruled(1), parstatus(1), cplxmodify(1M), frupower(1M), parcreate(1M), parmgr(1M), parmodify(1M), parolrad(1M), parremove(1M), parun- lock(1M), partition(5). on on on parconfig(1M)
All times are GMT -4. The time now is 11:13 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy