Softpedia
 


LINUX CATEGORIES:



GLOBAL PAGES >>
NEWS ARCHIVE >>
SOFTPEDIA REVIEWS >>
MEET THE EDITORS >>
WEEK'S BEST
  • Linux Kernel 3.9.3 / 3....
  • LibreOffice 3.6.6 / 4.0.3
  • MPlayer 1.1.1
  • systemd 204
  • Arch Linux 2013.05.01
  • Blender 2.67
  • KDE Software Compilatio...
  • CrunchBang Linux Stable...
  • Elementary OS 0.1 / 0.2...
  • SystemRescueCd 3.6.0
  • Home > Linux > Text Editing&Processing > Others

    edifact2awk 1.0

    Download button

    No screenshots available
    Downloads: 961  View global page NEW!  Tell us about an update
    User Rating:
    Rated by:
    Good (3.0/5)
    18 user(s)
    Developer:

    License / Price:

    Last Updated:

    Category:
    Patrick Kaell | More programs
    GPL / FREE
    July 28th, 2008, 13:09 GMT
    ROOT / Text Editing&Processing / Others

     Read user reviews (1)  Refer to a friend  Subscribe

    edifact2awk description

    edifact2awk is a small C program that parses an EDIFACT file and converts it to a flat text file.

    edifact2awk is a small C program that parses an EDIFACT file and converts it to a flat text file which may then be easily parsed by the AWK textprocessing language (including by other script languages like Perl, Python, Visual Basic, etc.). It interprets the UNA segment and performs the following modifications:

    · the segment separator is replaced by a newline
    · the data element separator is replaced by a tab
    · the component data element separator is replaced by a dollar symbol $
    · the release character is interpreted

    edifact2awk reads the EDIFACT file on the standard input stream (stdin) and outputs the flat text file on the standard output stream (stdout). The program is safe from buffer overflow attacks as it is completely stream orientated and can handle any segment sizes without using internal buffers and dynamic memory. Here is an example which shows how it may be used on the UNIX commandline:

    edifact2awk < edifactfile | awk -f awkscript

    AWK script:

    The AWK script may be structured in the following way (example):

    BEGIN {
    FS = "t"
    }

    $1 == "UNB" {
    exp = $3
    prep = $5

    ...
    }

    $1 == "NAD" && $2 == "CR4" {
    func = $2
    trav = $5

    ...
    }

    ...

    END {
    ...
    }


    The component data elements cannot be automatically separated by AWK. You have to use the index function to search for the dollar symbol and use substr to separate the component data elements.

    Compilation:

    edifact2awk should compile on any ANSI C compiler and run on any platform (including Windows). Here is an example which shows how it may be compiled on UNIX:

    cc -O2 -o edifact2awk edifact2awk.c
    strip edifact2awk


    Product's homepage

      


    TAGS:

    EDIFACT parser | EDIFACT converter | text processing | EDIFACT | parser | converter

    Go to top

    WindowsGamesDriversMacLinuxScriptsMobileHandheldNews

    SUBMIT PROGRAM   |   ADVERTISE   |   GET HELP   |   SEND US FEEDBACK   |   RSS FEEDS   |   UPDATE YOUR SOFTWARE   |   ROMANIAN FORUM