append variable string in a specific line
I want to append a variable string to the end of a specific line. not like append the same string to each line.
like in my file i have 4 columns, i want to add a string in 5th column in some fixed row. Any help will be very welcome. Thanks in advance.. |
It would help if you gave a few details. Post an example of what the text looks like; i.e. the before and after states of the file. Also, how will you match the line? By line number, or by some content?
In any case, either sed or awk can do what you want quite easily. |
i am putting the output of time command into a file.
like /usr/bin/time -f -o -a abc.txt "\t%E Real-time \t%S TotalCPUseconds" and after that in the same line i want to put some file name abns.txt like: 0:00.00 Real-time 0.00 TotalCPUseconds abns.txt but its doing like 0:00.00 Real-time 0.00 TotalCPUseconds abns.txt.. may be i need to remove end of line from time output?? |
I am not sure I understand the issue??
You already have free text in your output, so why not just add the file name on the end: Code:
/usr/bin/time -f -o -a abc.txt "\t%E Real-time \t%S TotalCPUseconds abns.txt" |
thanx
|
All times are GMT -5. The time now is 07:49 PM. |