10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
consider a file called mobile.txt as follows:
For type lovers, add a new line at the end of it by copying its previous line and add a +1 to the field1, field2
Additionally, there are only 3 plans available to lovers type, so it should not work for lovers type already having 3 lines under... (11 Replies)
Discussion started by: Gautham
2. Shell Programming and Scripting
I have following file contents
I would like to comment line line=eeeeee and insert a new line... (19 Replies)
Discussion started by: manishdivs
3. Shell Programming and Scripting
I am new to perl scripting, I have a text file, and would like to insert 3 new lines into the same file at different line numbers using perl scripting. Any Help regarding this will be very useful.
say the file is sample.txt, contents are
ffffffff... (4 Replies)
Discussion started by: hemalathak10
4. Shell Programming and Scripting
I have this line:
I want to insert this IP 18.104.22.168 between "144"... (4 Replies)
Discussion started by: iga3725
5. Shell Programming and Scripting
I have posted it previously but somehow could not delete the previous post.I felt i could not explain the problem statement well.
Here t goes.I have a file say File1. Now i need a specific pattern from the lines to be added to the other line.
red blue green ABC.txt@ABC END
black... (1 Reply)
Discussion started by: ngupta
6. Shell Programming and Scripting
I have to append every alternate line after its previous line. For example if my file has following contents
line 1: unix is an OS
line 2: it is open source
line 3: it supports shell programming
line 4: we can write shell scripts
Required output should be
line1: unix is an OS it is... (4 Replies)
Discussion started by: rish_max
7. Shell Programming and Scripting
I need a perl script to find and replace a specific pattern in a file to a new line.
BAsically I have a single line data in a file with 10 mb to 200 MB. I want to put a new line based on a specific pattern to open the file in Excel / Access.
Following is the sample data in a file
... (1 Reply)
Discussion started by: portalfaq
8. UNIX for Advanced & Expert Users
Is there any command where we can insert a line "2|||" before every line starting with "3|"
my input is as follows
2|EN_GB||Electrogalvanize 0.5 m2 ( Renault )
desired output... (10 Replies)
Discussion started by: laxmi131
9. Shell Programming and Scripting
I'm sure you guys have answered this elsewhere but I can't seem to find where so here goes.
a=$(sed '120q;d' energy.xvg)
a=$(sed $n'q;d' energy.xvg)
echo "$a \n" > newfile
that script should read the file energy.xvg, start at... (1 Reply)
Discussion started by: gelitini
10. Shell Programming and Scripting
I have a file called football where i have a list of 11 players each on different lines.
I wish to add a name of another player on the first line.
I have created a file called footballscript in vi writing the following sed command to achieve this ...
cat football | sed -e '1 i\... (4 Replies)
Discussion started by: Mary_xxx