10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
i have lines in a file similar to this:
results=$(echo Total: ${res} | command | command)
now I need to add text before the word "results", but i dont know how to do it.
here's what i tried:
%s~results=.*echo Total:.* ${7}~PROCESS \; results=.*echo Total:.* ${7}~g
the problem is,... (1 Reply)
Discussion started by: SkySmart
1 Replies
2. Shell Programming and Scripting
Hi All,
I am trying to edit the next line when there is a success for a pattern.
For example:
<nvname>abc</nvname>
<nvvalue>1</nvvalue>
<nvname>def</nvname>
<nvvalue>2</nvvalue>
once there is a hit for the string "abc" the value of the nvvalue should be replaced with the value we... (5 Replies)
Discussion started by: pulgupta
5 Replies
3. Shell Programming and Scripting
I have a sample file as below :-
RECORD_COUNT|2660|28606946.86|20110701122349694|
adkad|wwsgesg|mkmk|FFFF|FAFAF|FFAF|FAFFFFA|5894858|
I have to replace the second coulmn in the first row which is the count of no of lines in the file from a new variable .
Also I have to delete the 3rd... (2 Replies)
Discussion started by: Sanjeev Yadav
2 Replies
4. UNIX for Dummies Questions & Answers
Hi All
I would like to break down each next line that matches SK1.chr* in this case NNNNNN.... into 100 characters each after SK1.chr*... (3 Replies)
Discussion started by: pawannoel
3 Replies
5. Shell Programming and Scripting
Hello,
i have a file, i open the file and read the line, i want to get the first item in the csv file and also teh third+6 item and wirte it to a new csv file. only problem is that using echo it takes TOO LONG:
please help a newbie. below is my code:
WorkingDir=$1
FileName=`cut -d ',' -f... (2 Replies)
Discussion started by: limamichelle
2 Replies
6. Shell Programming and Scripting
I have two files which I would like to compare and then manipulate in a way.
File1:
pictures.txt 1.1 1.3
dance.txt 1.2 1.4
treehouse.txt 1.3 1.5
File2:
pictures.txt 1.5 ref2313 1.4 ref2345 1.3 ref5432 1.2 ref4244
dance.txt 1.6 ref2342 1.5 ref2352 1.4 ref0695 1.3 ref5738 1.2... (1 Reply)
Discussion started by: linuxkid
1 Replies
7. UNIX for Dummies Questions & Answers
I have some trouble editing a line. My aim is to edit the first line of a file.It will look the code and if there are dummy characters at the begininng of line before < it will erase. It is a php code.For instance:
for instance if the first line is like
%^<?php>sadsa</php>, it will change it to... (6 Replies)
Discussion started by: king87
6 Replies
8. Shell Programming and Scripting
Hello everyone. I have been reading a lot about the various different text editors at my disposal through Unix, but I just can't seem to close the deal for what I am trying to do. Is there a way to issue a single line command to edit a file where pattern=x, and do it non-destructively AND in-place?... (1 Reply)
Discussion started by: gator76
1 Replies
9. Shell Programming and Scripting
Hi All,
Could you please help me out with this problem?
I need to edit the last line of my file.
Ex: The last line in my file will be say 000056000045 8
I need to subtract some number from the number 45 and replace the new number in its place.
... (1 Reply)
Discussion started by: Anitha Chandran
1 Replies
10. UNIX for Dummies Questions & Answers
Is there a way using bash that I can edit a command line using vi.
I.e. if I have a long command line and I want to edit it.....by typing vi and then having the command open in an editing window....
I beleive this can be done in k shell by pressing v....however can find out how this can be... (3 Replies)
Discussion started by: peter.herlihy
3 Replies