July 2018
Beginner
264 pages
8h 9m
English
Let's begin our activity as follows:
#!/bin/bash# Import template variablessource xml-parent.tplsource word.tplOUTPUT_FILE="words.xml"INPUT_FILE="words.csv"DELIMITER=','# Setup headerecho ${XML_HDR} > ${OUTPUT_FILE}echo ${SRT_CONTR} >> ${OUTPUT_FILE}# Enter contentecho ${ELM} | \sed '{:q;N;s/\n/\\n/g;t q}'| \awk \'{ print "awk \x27 BEGIN{FS=\"'${DELIMITER}'\"}{print "$0"}\x27 '${INPUT_FILE}'"}' | \ sh >> ${OUTPUT_FILE}# Append trailerecho ${END_CONTR} >> ${OUTPUT_FILE}cat ${OUTPUT_FILE}
Read now
Unlock full access