10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I have several line in a text file. for example
I like apple;
I like apple
I like orange;
Output: I like apple
I try to useif grep -q "!\;$"; then (Not work)
Please use CODE tags when displaying sample input, sample output, and code segments (as required by forum rules). (1 Reply)
Discussion started by: cmdcmd
2. Shell Programming and Scripting
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:
111... (7 Replies)
Discussion started by: bagvian
3. Shell Programming and Scripting
I have a file with the below format (ABC.TXT) :
I need to write a script where it will check for : blank lines (between rows,before... (6 Replies)
Discussion started by: chatwithsaurav
4. Shell Programming and Scripting
I am creating a shell script which will check the processing of the main script if the error count is more than 2% of the record count in a feed. Part of the code is below:
err_tol=`echo $feed_cnt \* 0.02 |bc`
while read line
err_cnt=$(grep -i "$line" $err_log | wc -l)
... (5 Replies)
Discussion started by: member2014
5. Shell Programming and Scripting
I have below file. I want to remove space at begining of every line and then after also remove blank line from file.
I use below code for each operation.
sed -e 's/^*//' < check.txt > check1.txt
sed '/^\s*$/d' < check1.txt > check2.txt
above code not remove all the space... (12 Replies)
Discussion started by: Mohin Jain
6. Shell Programming and Scripting
Hi Scripting Gurus,
Can someone help to transform the below logic into a shell script, might be easy for some of you.
I have a file with below text, I need if the line has the ":" and the above to it is not a blank line should print " <text>: is incorrect format"
... (3 Replies)
Discussion started by: usyseng
7. Shell Programming and Scripting
I need to match lines after a pattern, upto the first blank line.
Searched in web and some forums but coulnt find the answer.
where <restart_step> =
10 -- Execute query
20 -- Write the contents to the Oracle table
30 -- Writing Contents to OUTPUT... (7 Replies)
Discussion started by: justchill
8. Shell Programming and Scripting
I did the following script:
DIR=`pwd`;for i in `find . -name GESTION -type d`;do cd $i/..;setfacl -R -m g:directores:rwx,
GESTION;echo $DIR'/'$i;cd $DIR;done
This code do the following actions:
1. Starting inside a folder, it's searching for any folder called "GESTION"
2. Every time... (3 Replies)
Discussion started by: argie01
9. Shell Programming and Scripting
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?
Magesh (9 Replies)
Discussion started by: mac4rfree
10. Shell Programming and Scripting
I have a script which accepts a parameter which can either be blank, a specific value, or a wildcard value. But it never seems to be blank and the wildcard option seems to return the names of matching files in my directory. This happens even with the worlds simplest script that just... (1 Reply)
Discussion started by: cdines