#!/bin/sh -vx # Script to add line breaks after the delimiter of an EDI file. # Paramters: filename input file (edi data file) # output file to be written # delimiter ending delimiter of EDI file (\, *, ~, etc) ############################################################################ # Variables filename=$1 output=$2 delim=$3 replace='s/'$delim'/\n/g' cat $1 | tr -d "\n" > $output.br4 cat $output.br4 | sed -e $replace > $output
Usage:
# linebreak.sh <filename> <output filename> <delimiter>
Text Sample:
v1,v2*v3,v4*v5,v46*
Example:
# linbreak.sh /example.txt /example_parsed.txt \*
Note: You have to escape special characters
Output:
v1,v2* v3,v4* v5,v46*


Sign In
Create Account

Guest_Jordan_*
Back to top









