👤
Home Man
Search
Today's Posts
Register


Awk to remove carriage return from 65th field

Shell Programming and Scripting




Kindly Note - This is a Single User Post by Forum Member Corona688 Regarding:
Awk to remove carriage return from 65th field.
Please Follow The Primary Link Above to View the Full Discussion.

Old 03-22-2012
Why would carriage returns be wanted in any of the records, unless the entire file is delimited with \r\n ? Whether it is would be good to know.

Code:
awk -F"|" 'NF==65 { sub(/\r/, ""); T=$0; getline; print T $0; next} 1'