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.
SED changes by columns
Name: braveking Date: February 3, 2004 at 09:03:39 Pacific OS: Solaris CPU/Ram: 512
Comment:
Is there an easy way to tell sed command to make changes only in certain columns?
For example, if my input is 121| 3| apple | 312| 005| |
The output should be 121|3| apple | 312|005| |
In other words, i only want to change spaces in column 2.
My code currently replacing spaces in all instances. sed -e 's/ //g' inputfile
Summary: I've got a question about the sed command. I have a file named phone.list which contains four fields what would the sed command be to print the first two columns of the file but in reverse order exam...
Summary: The following code will pass a file (with no changes) by keeping the last two lines in its buffer. The N appends the second line, and the P and D will print and delete the first of the two lines. sed...
Summary: No, those are single dimension arrays. But you can store your whole lines in an array like you are doing now, and pull one of those lines into a second array so that the numbers can be arrayed. Here...