The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
Google UNIX.COM



View Single Post in UNIX Forums - Click on the Thread or Permalink to View Entire Thread -->
  #1 (permalink)  
Old 05-16-2008
jeter jeter is offline
Registered User
 

Join Date: Jul 2005
Posts: 11
replace a newline (\n)

dear all:
maybe i have a file like :
12

34

56
78
end

how do write can i replace newline into NA :
make the file inte :
12
NA
34
NA
56
78
END

I wrote a shell like:
foreach a (fiel){
if a == ""
set $a=NA
}
but can't work maybe someone can help me
Reply With Quote
Forum Sponsor