10 More Discussions You Might Find Interesting
1. UNIX for Beginners Questions & Answers
Hi, I need to print lines which are matching with start pattern "SELECT" and END PATTERN ";" and only select the last "select" statement including the ";" .
I have attached sample input file and the desired input should be as:
INPUT FORMAT:
SELECT
ABCD,
DEFGH,
DFGHJ,
JKLMN,
AXCVB,... (5 Replies)
Discussion started by: nani2019
5 Replies
2. UNIX for Beginners Questions & Answers
Hi,
I am trying to generate a data of following order:
4 0 1 642 643
4 642 643 1283 1284
4 1283 1284 1924 1925
4 1924 1925 2565 2566
4 2565 2566 3206 3207
4 3206 3207 3847 3848
4 3847 3848 4488 4489
4 4488 4489 5129 5130
----------------------
4 1 2 643 644
4 643 644 1284... (6 Replies)
Discussion started by: SaPa
6 Replies
3. UNIX for Beginners Questions & Answers
Hi all,
I'm looking for a way (sed or awk) to delete multiple lines between blank lines containing two patterns ex:
user: alpha
parameter_1 = 15
parameter_2 = 1
parameter_3 = 0
user: alpha
parameter_1 = 15
parameter_2 = 1
parameter_3 = 0
user: alpha
parameter_1 = 16... (3 Replies)
Discussion started by: ce9888
3 Replies
4. Shell Programming and Scripting
(I am using bash)
I have a command that will find the line number in a file by searching for a string where it exists.
linenumber=$(grep -n "string" $FILENAME | cut -d : -fi)
This returns the line number and removes the string. Now that I have the line number I want to subtract 4 from it and... (5 Replies)
Discussion started by: prodigious8
5 Replies
5. Shell Programming and Scripting
Hi All,
I need a help in the below scenario.
I want to perform few operations as a non root user but those operations can be performed only by the root user. For example I need to modify /etc/hosts file as a non root user. This is just one scenario.
Could you please provide... (3 Replies)
Discussion started by: kalpeer
3 Replies
6. Shell Programming and Scripting
Hello all,
I am looking for a solution to the following problem. Perl or python solutions also welcome.
Given this input:
And this input:
I want to get this output.
The rule being that if the number in the first file is < 0.9, then the corresponding two columns on... (2 Replies)
Discussion started by: hydrabane
2 Replies
7. Shell Programming and Scripting
hi,
I have the following file
hello
world
this
is
to
say
bye
to
everyone
so
bye
I want to get the lines from hello to the first bye inclusive into another file?
how can I do this (11 Replies)
Discussion started by: JamesByars
11 Replies
8. Shell Programming and Scripting
Hi All ,
Given a file , I need to delete , modify and insert lines matching certain patterns in that file using shell scripting.
e.g. If a file FILE1 has following content :
CUST.ABC.DEF = CUST.ABC.DEF * CUST.ABC.DEF
PRINTF(CUST.ABC.DEF)
CUST.ABC.DEF = mid(CUST.ABC.DEF,10.34)... (5 Replies)
Discussion started by: swapnil.nawale
5 Replies
9. Shell Programming and Scripting
Hi Gurus,
I have a file say for ex. file1 which has 3500 lines in it which are different account numbers and another file (file2) which has 230000 lines in it. I want to read all the lines in file1 and delete all those lines from file2 which has that same pattern as in file1. I am not quite... (4 Replies)
Discussion started by: toms
4 Replies
10. Shell Programming and Scripting
Hi:
Let's suppose I want to replace all the | by > ONLY when | is between . Usually (and it works) I would do something like
sed -e 's/\(\*\)|\(*\]\)/\1>\2/g'
where I have to "save" some portions of the matched region and use them with the \n metacharacter. I was wondering if I could... (2 Replies)
Discussion started by: islegmar
2 Replies