Add new parameters into a line, and redirect the line to other file
How can i add new parameters into a line, and redirect the line to other file?
For example:
1.sh
I want a, for example 2.sh with:
In the 2.sh, I added a new column: description and the parametrs.
I have builded a function to add things into file like: addreg "$name:$owner"
I tried to make this but i cant get the result. The way I found to avoid this, is to put into the original file the fields like google:richard:description and when I want to insert the description I search the words description and edit to the $description that I insert.
Hope you can understand my english
---------- Post updated at 05:40 PM ---------- Previous update was at 03:15 PM ----------
I'm sure there's much more to your process than you've listed; for example, I don't see where you're getting the third column's contents...and your function's $c.
However, please note:
1) Probably a Typo in your "if" statement (existe should be exists...?);
2) Assuming you're getting your third column contents from somewhere:
The third column is asked to the user, with a echo "add description" read description.
I dont know how I can add a third column in the line. I think, this might result. I will test and thank you!
---------- Post updated at 09:24 PM ---------- Previous update was at 09:19 PM ----------
The tail function is perfect i think. But the number -3 is the number of lines that will be extracted. How can i check the number when i dont know how many lines are in the file? Use a counter right? and if I wanna extract a certain line like the line with $name google. How can i do that?
---------- Post updated at 09:25 PM ---------- Previous update was at 09:24 PM ----------
Hi all,
I have a log file say Test.log that gets updated continuously and it has data in pipe separated format. A sample log file would look like:
<date1>|<data1>|<url1>|<result1>
<date2>|<data2>|<url2>|<result2>
<date3>|<data3>|<url3>|<result3>
<date4>|<data4>|<url4>|<result4>
What I... (3 Replies)
Hello,
I need a program that read a file line by line and prints out lines 1, 2 & 3 after an empty line... An example of entries in the file would be:
SRVXPAPI001 ERRO JUN24 07:28:34 1775
REASON= 0000, PROCID= #E506 #1065: TPCIPPR, INDEX= 003F
... (8 Replies)
Hi,
I want to achieve something similar to what described in another post:
The difference is I want to add the line if the pattern is not found.
File 1:
A123, valueA, valueB
B234, valueA, valueB
C345, valueA, valueB
D456, valueA, valueB
E567, valueA, valueB
F678, valueA, valueB
... (11 Replies)
I cannot seem to get this to work..
I have a file which has about 100 lines, and there is no end of line (line break \n) at the end of each line, and this is causing problem when i paste them into an application.
the file looks like this
this is a test
that is a test
balblblablblhblbha... (1 Reply)
So, I want to read line-by-line a text file with unknown number of files....
So:
a=1
b=1
while ; do
b=`sed -n '$ap' test`
a=`expr $a + 1`
$here do something with b etc
done
the problem is that sed does not seem to recognise the $a, even when trying
sed -n ' $a p'
So, I cannot read... (3 Replies)
Hi
Trying to do like this :
echo "$variable1\n $(cat file.txt)"
but it only adds one time. When I run this cmd again with different variable it only replaces line of variable1.
How to add constantly line into first line in file ? (3 Replies)
Hello All,
I have a doubt in sed, i want to add some parameter at the end of the tag inside a xml tag. how to i do that. so i want to add Results="true" value="high" inside the xml tag.
Orignal
<execute description="reboot">
<execute description="Stop Servlet">
After adding the... (5 Replies)
File 1
<html>ta da....unique file name I want to give file=>343...</html>
<html>da ta 234 </html>
<html>pa da 542 </html>
and so on...
File 2
343
234
542
and so on, each line in File 1 one also corresponds with each line in File 2
I have tried several grep, sed, while .. read, do,... (4 Replies)