You might also consider giving us bit of
wider context for the request. There may be other, better techniques available depending on exactly what you intend to do with the data.
For example, if you are going to process each line in a shell loop, then you could break up each line into separate variables (or an array) with
read.
Code:
while IFS=':' read -r f1 f2 f3 f4 f5 ; do
echo "field one is: $f1"
echo "field two is: $f2"
#...etc...
done <infile.txt
How can I read a file (data stream, variable) line-by-line (and/or field-by-field)?
http://mywiki.wooledge.org/BashFAQ/001
Similarly, complex work on field-based data is just what
awk was designed to do. You may be able to do everything you want in it alone.
http://www.grymoire.com/Unix/Awk.html
http://www.gnu.org/software/gawk/man...ode/index.html
Of course, if you really did just want to replace colons with spaces, then carry on.
PS: Please use ***
[code][/code]*** tags around your code and data, to preserve the original formatting and to improve readability. Do
not use quote tags, bolding, colors, "start/end" lines, or other creative techniques. Thanks.