Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.
Search and Replace command
Name: roneo Date: February 6, 2002 at 15:51:24 Pacific
Comment:
I am trying to write a Unix Shell Script command that would clean up the XML files by eliminating spaces between the nodes...example:
Or if you want to eliminate both the null lines and lines that contain only white space, you could use:
awk 'NF>0' myfile > mynewfile
0
Response Number 2
Name: Yeheya Ansari Date: February 9, 2002 at 23:18:37 Pacific
Reply:
Hi! If u want to remove space, u can use the following command:- sed "s/ *//g"
i.e sed "s/*//g" {ur input file} This will output the required file on screen. U can redirect this to any file using >
For ex: sed "s/ *//g" myxml >reqxml
If u want to remove spaces or tabs, then u can use this (Pls try following...I am not sure at this moment for this)
sed "s/[ ]*//g" {Input File}
i.e sed "s/[]*//g" {input file}
I hope this will server u
0
Response Number 3
Name: Ritesh Date: June 24, 2002 at 10:24:45 Pacific
Reply:
I think you have to read the XML document using XML processor/parser and then write it again. I think that using unix commands will not be that useful.
Summary: I am working w/ this huge matrix file. Now in this matrix file 2nd column is strings. lets say its contain red, blue, black. now i can not load this file in matlab. so i wanted to change red to 1 bl...
Summary: Hi, Can anyone help me with the command to do the following search and replace in the following files: Files: file1 file2 file3 Search String: "GET /thisfile?id= Replace String: "GET /thisfile?source=...
Summary: Is it possible to do search and replace in unix Like : s/some date/current date/g some date and current date both are in same format (dd/mm/yyyy hh:mm:ss) My requirement is : I am having a variable w...