10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi Guys,
I am stuck in between and seeking help here.
Requirement: A script that will run every morning which will connect to Mysql database and run the query to inform us about the holidays (it will also check if there were any holidays during last 2 business days). So the three queries are... (11 Replies)
Discussion started by: Sambit Sahu
11 Replies
2. Shell Programming and Scripting
Dear All,
In a CSV file, say that a given column has been extracted. In that column, information is missing (i.e. blank lines appear). I would like to replace the blank lines by the last valid line (not blank) previously read.
For example, consider the extract below:
123
234
543
111... (7 Replies)
Discussion started by: bagvian
7 Replies
3. Shell Programming and Scripting
Dear all
I want to search special string in file and then print next all line in one line until blank lines come. Help me plz for same. My input file and desire op file is as under.
i/p file:
A1/EXT "BSCABD1_21233G1" 757 130823 1157
RADIO X-CEIVER ADMINISTRATION
BTS EXTERNAL FAULT
... (7 Replies)
Discussion started by: jaydeep_sadaria
7 Replies
4. Shell Programming and Scripting
Hi,
I need to insert a new line containing the string "QUERY" above every 5 lines.
The below piece of code inserts a new line after every 5th line
awk '{print $0} !(NR%5) {print "QUERY"}'
sed 'n;n;n;n;G;' --> I do not know how to give "QUERY" string here
But I need to insert it before... (4 Replies)
Discussion started by: royalibrahim
4 Replies
5. Shell Programming and Scripting
I use the following as part of a script to correct for a faulty hostname file.
# get the domain name
read -r thehostname < /etc/hostname
dom="$(echo $thehostname | cut -d'.' -f2)"
numchar=${#dom}
if
then
echo "It appears as though the hostname is not correctly set."
echo "Hostname has... (5 Replies)
Discussion started by: bugeye
5 Replies
6. Shell Programming and Scripting
FIle A
"A" 2 aa 34
3 ac
5 cd
"B" 3 hu 67
4 fg
5 gy
output shud be
A"" 2 aa 34
"A" 3 ac 34
"A" 5 cd 34
"B" 3 hu 67
"B" 4 fg 67
"B" 5 gy 67 (6 Replies)
Discussion started by: cdfd123
6 Replies
7. Shell Programming and Scripting
Hi Guys,
I have a file in which each set of records are separated by two blank line. I want to replace it with a single blank line.
Can you guys help me out?
Regards,
Magesh (9 Replies)
Discussion started by: mac4rfree
9 Replies
8. Shell Programming and Scripting
the following range matching works great but i wish to add a blank line after each range result set... which i've tried and researched to no avail
MY INPUT DATA:
CURRENT CODE I'M USING:
sed -n '/*$/,/;/p' $INPUT_FILE
RESULTS I'M GETTING:
RESULT I looking to... (5 Replies)
Discussion started by: danmauer
5 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
I followed the egrep example given in the thread "parse text or complex grep ?". It is exactly what I need...except... how do I insert a blank line after the second line? My exact command is:
egrep 'patt1|patt2' filename
the result is:
patt1
patt2
patt1
patt2
and so on. I would... (2 Replies)
Discussion started by: antalexi
2 Replies