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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

reading file

Status
Not open for further replies.

sabetik

IS-IT--Management
Nov 16, 2003
80
GU
Is there a way to insert a tab (5 spaces) between each field. I would like to change the "," to 5 spaces.


This is my input file:
pn,description,price
AU015-, O/M 6FGCU33-45,4.96
AU315-1, O/M 7FBH15-25,5.15
AU317-, O/M 7FBCU15-55,5.15
 
Why not a simple sed ?
sed 's!,! !g' /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
 
PH. Do not have access to sed. How about awk
 
wow that's something new - a system with 'awk', but with no 'sed'. What OS is that?

Code:
nawk -F',' -v OFS='     ' '$1=$1' myInputFile

vlad
+----------------------------+
| #include<disclaimer.h> |
+----------------------------+
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top