10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Sed command to replace a line in a file using line number from the output of a pipe.
Is it possible to replace a whole line piped from someother command into a file at paritcular line...
here is some basic execution flow..
the line number is 412
Now i have a line... (1 Reply)
Discussion started by: vivek d r
2. Shell Programming and Scripting
I've a file like this..
a,13 (7 Replies)
Discussion started by: manab86
3. Shell Programming and Scripting
I have a set of files in a directory that I have to read and replace the first occurrence of a number with another dummy number. This is what I have so far but it does not seem to work. The files have lot of other data in each row and each data element is separated by ,@,
for file in... (13 Replies)
Discussion started by: scorpioraghu
4. Shell Programming and Scripting
I don't really know anything about scripting, but I have to manage to make this script, out of necessity.
while read -r line; do #I'm reading from a big wordlist
instructions using $line
Is there a way to automatically write the $line number the script... (4 Replies)
Discussion started by: bobylapointe
5. Shell Programming and Scripting
Can you please guide me to search a string in a particular column of file and return the line number of the line where it was found using awk. As an example :
8001,nike,1,5,0,1,8... (3 Replies)
Discussion started by: arunshankar.c
6. Shell Programming and Scripting
I was trying to search the following scenario on the forum but was not able to.
Let's say that I have a very large file that has some bad data in it (for ex: 0.0015 in the 12th column) and I would like to find the line number and remove that particular line.
What's the easiest... (3 Replies)
Discussion started by: pchang
7. UNIX for Dummies Questions & Answers
I am trying to display contains of a file from a specific line to a specific line(let say, from line number 3 to line number 5). For this I got the shell script as shown below:
if ; then
if ; then
tail +$1 $3 | head -n $2
... (5 Replies)
Discussion started by: grc
8. Shell Programming and Scripting
I have a huge file & I want to add a specific text in column. But I want to add this text from a specific line number to a specific line number & another text in to another range of line numbers.
To be more specific: lets say my file has 1000 lines & 4 Columns. I want to add text "Hello"... (2 Replies)
Discussion started by: Ezy
9. Shell Programming and Scripting
Hello, I need help in appending the line number of each line to the file and also to get the total number of lines. Can somebody please help me.
I have a file say:
The output should be:
... (2 Replies)
Discussion started by: chiru_h
10. Shell Programming and Scripting
Hi, I am a newb as far as shell scripting and SED goes so bear with me on this one.
I want to basically append to each line in a file a delimiter character and the line's line number e.g
Change the file from :-
I have worked... (4 Replies)
Discussion started by: pjcwhite