10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Hello!
My final exam in my Linux class is tomorrow, and I was just reviewing the grep and sed commands. I came across an example, by which I got stumped: it asks to provide a sed command that deletes all lines that contain exactly 3 to 5 digit strings, from a file.
In this case, I created a... (3 Replies)
Discussion started by: kalpcalp
3 Replies
2. Shell Programming and Scripting
I have written a script to parse data from some files on a Solaris 10 system and send the output to a CSV formatted file. The code snipped i am using to pull the data is as follows....
src_line=$(sed -n "/^search_pattern$/{=;}" $file)
for i in $src_line
do
start_line1=$(( i + 9 ))
nawk -v... (4 Replies)
Discussion started by: electricheadx
4 Replies
3. Shell Programming and Scripting
here is what i want to achieve.. i have a file with below contents
cat fileName
blah blah blah
.
.DROP this
REJECT that
.
--sport 7800 -j REJECT --reject-with icmp-port-unreachable
--dport 7800 -j REJECT --reject-with icmp-port-unreachable
.
.
.
more blah blah blah
--dport 3306... (14 Replies)
Discussion started by: vivek d r
14 Replies
4. Shell Programming and Scripting
Hi,
I am trying to create a csv from a existing flat file.I am using the same data to create the csv file. But I have issues \10 columns onwards..
sed... (5 Replies)
Discussion started by: babom
5 Replies
5. Shell Programming and Scripting
Hi ,
how to add the single digit to front of the word and front of the lines in the one file with compare pattern file and get digit. like example
pattern file pattern.txt
pattern num
bala 2
raja 3
muthu 4
File Name: chennai.dat
muthu is good boy
raja is bad boy
selvam in super... (6 Replies)
Discussion started by: krbala1985
6 Replies
6. Shell Programming and Scripting
Hi All,
Please can someone assist in the script I have made that searches a pattern in a file and delete the whole line containing the pattern.
#!bin/sh
# The pattern that user want to add to the files
echo "Enter the pattern of the redirect"
read value
# check if the user has... (1 Reply)
Discussion started by: Shazin
1 Replies
7. Shell Programming and Scripting
Hello friends,
Only very recently i started learning sed command...an i found that sed is faster in finding the patterns than some of my scripts that uses grep to check the patten inside a file using line by line search method which is time consuming.
The below script... (4 Replies)
Discussion started by: frozensmilz
4 Replies
8. Shell Programming and Scripting
Hi,
Please take a look at the below eg. I would like to search for abc() pattern first and then search for (xyz) in the next line. If I can find the pattern, then I should delete the 3 lines.
I can only find the pattern and delete but I am unable to find two patterns and delete. Any... (8 Replies)
Discussion started by: sreedevi
8 Replies
9. Shell Programming and Scripting
Hello friends,
I have a C source code containing sql statements. I use the following sed command to print all the sql blocks in the source code....
sed -n "/exec sql/,/;/p" Sample.cpp
The above sed command will print the sql blocks based on the pattern "exec sql" & ";"... (2 Replies)
Discussion started by: frozensmilz
2 Replies
10. UNIX for Dummies Questions & Answers
Hi All,
I have a file named pattern.dat which contains pattern like
A1000090 250.00 250.00
i have one more file named test.dat in which this pattern is present.
What i should do is, in test.dat after this pattern i should append comments.
i used... (4 Replies)
Discussion started by: Sona
4 Replies