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, In my previous post ( How to print lines from a files with specific start and end patterns and pick only the last lines? ), i have got a help to get the last select statement from a file, now i need to remove/exclude the output from main file:
Input File format:
SELECT
ABCD,
DEFGH,... (2 Replies)
Discussion started by: nani2019
2 Replies
3. Shell Programming and Scripting
How to sum up and print into the next line the total SUM.
]$ cat hhhh
aaa1a 1
aaa1g 2
aaa1f 3
baa4f 3
baa4d 4
baa4s 4
cddg1 3
cddg3 4
cddfg 1
$ cat hhhh|awk ' {sum+=$2} END {print sum}'
25
Desire output:
aaa1a 1 (13 Replies)
Discussion started by: kenshinhimura
13 Replies
4. Shell Programming and Scripting
I have been searching and trying to come up with an awk that will perform the following on a
converted text file (original is a pdf).
1. Since the first two lines are (begin with) text they are removed
2. if $1 is a number then all text is merged (combined) into one line until the next... (3 Replies)
Discussion started by: cmccabe
3 Replies
5. UNIX for Dummies Questions & Answers
I need to replace the (*) in the fist of a list with numbers using sed for example >
this file contain a list
* linux
* computers
* labs
* questions
to >>>>
this file contain a list
1. linux
2. computers
3. labs
4. questions (7 Replies)
Discussion started by: aalbazie
7 Replies
6. UNIX for Dummies Questions & Answers
Hi buddies ! I need some help with one grep command :) I have this table:
1 Petras Pavardenis 1980 5
08 Linas Bajoriunas 1970 10
3 Saulius Matikaitis 1982 2
5 Mindaugas Stulgis 1990... (1 Reply)
Discussion started by: vaidastf
1 Replies
7. UNIX for Dummies Questions & Answers
I have this space delimited large text file with more than 1,000,000+ columns and about 100 rows. I want to delete all the columns that start with NA such that:
File before modification
aa bb cc NA100 dd
aa b1 c2 NA101 de
File after modification
aa bb cc dd
aa b1 c2 de
How would I... (3 Replies)
Discussion started by: evelibertine
3 Replies
8. Shell Programming and Scripting
My folder is/app2/istech/scratch, which contain all the below files.
I need to delete the files which start from the prefixes.
dup_events_*.*
Event_*.*
New_time_*.*
New_Loc_*.*
New_Uptime_*.*
Detailed_Reason*.*
cmt_dup_*.*
Uptime_*.*
Can anyone please let me know how to write a... (3 Replies)
Discussion started by: dsnaveen
3 Replies
9. Shell Programming and Scripting
E.g. the file is like this:
I want to delete all lines that begin with a number larger than 2, ignoring the lines that doesn't begin with a number!
PS:'2' is actually a variable that can have a lot of values:b:i bet you got it (10 Replies)
Discussion started by: hakermania
10 Replies
10. Shell Programming and Scripting
Hello!
How do I remove the last two letters "GB" off each line, using awk?
What I need to remove is the "GB" in following input:
.....
30GB
2504GB
3GB
40GB
......
The OS used is Solaris9
Regards,
Fredrik (1 Reply)
Discussion started by: sap4ever
1 Replies