Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
Hi All,
Could somone suggest the solution for this problem?
The problem is that I have a abc.txt file in following format. Requiremnt is to:
1) get rid of top(first)line from file.
2) remove the extra white space from beginning of each line in file.
3) Remove the white space after word 'status' and before 'time' is displayed.Here's how current file looks like:
NameTestsErrorsFailuresTime(s)
testLoginInitialLoad Success 7.938
testFailedSignOn Success 7.156
testLoginSignOn Success 8.078
testHomeTabNone Success 16.469==================================
expected output should be :testLoginInitialLoad Success 7.938
testFailedSignOn Success 7.156
testLoginSignOn Success 8.078
testHomeTabNone Success 16.469
==================================You may not see the space in inmessage I posted but assume that there's space at beginning of each line and extra space after status.

1) get rid of top(first)line from file:
tail +2 input_file2) remove the extra white space from beginning of each line in file:
sed 's/^ //' input_file3) Remove the white space after word 'status' and before 'time' is displayed.
sed 's/status /status/' input_file
Informix/4GL

![]() |
![]() |
![]() |

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |