Delete a line from file which contain particular string (sed -e "/
print all lines except first line (sed -n '2,$p' vishnu.csv)
Convert YYYYMMDD to MM/DD/YYYY (echo "YYYYMMDD"|sed -n -e "s_\(....\)\(..\)\(..\)_\2/\3/\1_p")
Remove tab character from a file (sed -e \"s/[ <TAB>]*//g\" file > output)
Find and replace values in a file (sed -i 's/find1/replace1/g' fileName)
View only lines of a file that contains a particular string (sed -n '/string/p' fileName)
View particular row number (let say 3rd) of file (sed -n '3p;3q' fileName)
View range of row (let say 2 to 8) of file (sed -n '2,8p;8q' fileName)
Monday, October 13, 2008
sed examples
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment