10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Shell : bash
OS : RHEL 6.8
I have a file like below.
$ cat pattern.txt
hello
txt1
txt2
txt3
some other text
txt4
I want to remove all lines in this file except the ones starting with txt . How can I do this ? (4 Replies)
Discussion started by: omega3
4 Replies
2. UNIX for Beginners Questions & Answers
I have a file with a list of references towards the end and want to apply a grep for some string.
text ....
@unnumbered References
@sp 1
@paragraphindent 0
2017. @strong{Chalenski, D.A.}; Wang, K.; Tatanova, Maria; Lopez,
Jorge L.; Hatchell, P.; Dutta, P.; @strong{Small airgun... (1 Reply)
Discussion started by: kristinu
1 Replies
3. Shell Programming and Scripting
Hello,
I'm works on Ubuntu server
My goal : I would like to read file line per line, but i want to started at the end of file.
Currently, I use instructions :
while read line;
do
COMMAND
done < /var/log/apache2/access.log
But, the first line, i don't want this. The file is long... (5 Replies)
Discussion started by: Fuziion
5 Replies
4. Shell Programming and Scripting
Hi,
I want to read a file line by line and exclude the lines that are beginning with special characters. The below code is working fine except when the line starts with hyphen (-) in the file.
for TEST in `cat $FILE | grep -E -v '#|/+' | awk '{FS=":"}NF > 0{print $1}'`
do
.
.
done
How... (4 Replies)
Discussion started by: Srinraj Rao
4 Replies
5. Shell Programming and Scripting
Here is the task that I was presented with:
I am dealing with about a 10,000 line input deck file for an analysis. About 10 separate blocks of around 25 lines of code each need to be updated in the input deck.
The input deck (deckToChange in the code below) comes with 2 separate files. File 1... (5 Replies)
Discussion started by: tiktak292
5 Replies
6. UNIX for Dummies Questions & Answers
Hello,
I have a command that show some application information. Now, I have to grep there informations, like:
# showlog | grep 1266
1266.1369866124 ::
1266.1304711286 ::
41031.1161812668 ::
41078.1301266480 ::
41641.712662564 ::
1266.333792515 ::
41462.1512661988 ::
1266.54932671... (5 Replies)
Discussion started by: Lord Spectre
5 Replies
7. Shell Programming and Scripting
I have an input file
12.4 1.72849432773174e+01 -7.74784188610632e+01
12.5 9.59432114416327e-01 -7.87018212757537e+01
15.6 5.20139995965960e-01 -5.61612429666624e+01
29.3 3.76696387248366e+00 -7.42896194101892e+01
32.1 1.86899877018077e+01 -7.56508762501408e+01
35 6.98857157014640e+00... (2 Replies)
Discussion started by: chrisjorg
2 Replies
8. Shell Programming and Scripting
Hi All,
I have a .txt file with some contents as below:
Hi How are you?
# Fine and you?
I want a script file which reads the .txt file and output the lines which does not start with #.
Hi How are you?
Help is highly appreciated.
Please use code tags when posting data and... (5 Replies)
Discussion started by: bghosh
5 Replies
9. Shell Programming and Scripting
Hi Folks,
I got to know from this forums on how to grep from a particular line say line 6
awk 'NR==6 {print;exit}'
But how do i grep from line 6 till the end of the file or command output.
Thanks, (3 Replies)
Discussion started by: Mr. Zer0
3 Replies
10. Shell Programming and Scripting
hi,,
i hav a file with many lines.i need to remove all lines before a line begginning with a specific pattern from the file because these lines are not required.
Can u help me out with either a perl script or shell script
example:-
if file initially contains lines:
a
b
c
d
.1.2
d
e
f... (2 Replies)
Discussion started by: raksha.s
2 Replies