Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

^Z in position one in output file?

Status
Not open for further replies.

gbell

MIS
Feb 19, 2002
86
AU
A file we generate for eft payments to a bank has the character ^Z in position one, but not on every line. The file is generated by a Cobol program then dd is used to format it to a text file. I know ^Z has a special significance but I can't remember what it is. Can someone help me here please?

Ideally I would like to fix this at the source, to stop the ^Z appearing but failing that I guess I'll have to edit the text file to strip the ^Z's, can someone please give me the sed command for this.

Many thanks
Greg
 
Something like this ?
tr '\032' '' < /path/to/input > output

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
If you want to use sed, check out this FAQ:

faq80-1911
 
Thanks for the replies, especially the FAQ, which got me to thinking, there is a ux2dos command used and maybe it's the culprit with the ^Z
 
I had another look and there was no ^Z before the ux2dos and there was one after and I had a look at the script and can see where it's appending hence the multiple ^Z's. I checked the man page for ux2dos and have no options for removing rhe ^Z's.

if [ -f /interface/mincom/$1/$4 ]
then
dd if=$BEC_WORK/$2.$BEC_JOBNUM conv=unblock cbs=$3 | ux2dos >> /interface/mincom/$1/$4
else
dd if=$BEC_WORK/$2.$BEC_JOBNUM conv=unblock cbs=$3 | ux2dos > /interface/mincom/$1/$4
fi
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top