10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I want to write the syntax so does not count line with no space.
So currerntly it is showing lines as 5, but i want to show 4.
# cat /tmp/mediacheck | sort -u | grep -vi " " | awk '{print $1}' | wc -l
BA7552
BAA002
BAA003
BAA004 (6 Replies)
Discussion started by: Junes
6 Replies
2. UNIX Desktop Questions & Answers
Is there any way to add lines to the pattern space of sed?
I know a bit about the N flag, but am not able to use it to do what I want which is:
read a file n lines at a time. If I find a match I quit else move to the next line. e.g. if I am looking for the following three lines
Hello
How... (2 Replies)
Discussion started by: jawsnnn
2 Replies
3. Shell Programming and Scripting
I'm trying to extract all the lines between 2 strings (including the lines containing the strings)
To make the strings unique I need to include white space if possible. I'm not certain how to do that.
sed -n '/ string1 /,/string2/p' infile > outfile & (4 Replies)
Discussion started by: dcfargo
4 Replies
4. Shell Programming and Scripting
It sounds a bit confusing but what I have is a text file like the example below (without the Line1, Line2, Line3 etc. of course) and I want to move every group of characters into a new line after each space.
Example of text file;
line1 .digg-widget-theme2 ul { background: rgb(0, 0, 0) none... (7 Replies)
Discussion started by: lewk
7 Replies
5. Shell Programming and Scripting
Hi,
Please provide shell script to Remove empty lines(space) between two lines containing strings in a file.
Input File :
A1/EXT "BAP_BSC6/07B/00" 844 090602 1605
RXOCF-465 PDTR11 1
SITE ON BATTERY
A2/EXT... (3 Replies)
Discussion started by: sudhakaryadav
3 Replies
6. Shell Programming and Scripting
Hello,
I am currently trying to edit an ldif file. The ldif specification states that a newline followed by a space indicates the subsequent line is a continuation of the line. So, in order to search and replace properly and edit the file, I open the file in textwrangler, search for "\r " and... (14 Replies)
Discussion started by: rowie718
14 Replies
7. Shell Programming and Scripting
Hi!
I store some data obtained with grep or awk in a file. The problem is that some lines have white space at the begining :
line1
line2
line3
I use something like
grep WORD INFILE >> OUTFILE
awk >> OUTFILE
I would love if it were possible to remove the white whitout parsing the... (4 Replies)
Discussion started by: tipi
4 Replies
8. Shell Programming and Scripting
Hello all,
I am having trouble with setting up a regular expression used with egrep. My script reads an input file a line at a time. I would like the egrep command to search for the following pattern: server name at the beginning of the line, then one or more spaces, and then a pound sign.
... (5 Replies)
Discussion started by: Galt
5 Replies
9. UNIX for Advanced & Expert Users
Hi
file1.txt contains
GigabitEthernet1/1
GigabitEthernet1/2
GigabitEthernet2/2
GigabitEthernet2/4
GigabitEthernet2/14
GigabitEthernet2/16
can anyone show me how to modify it as below. there is a space at the beginning of the next two lines . ie 'no shut' and 'switch..'
!... (8 Replies)
Discussion started by: Aejaz
8 Replies
10. Shell Programming and Scripting
Not sure why this thread was closed without any explanation, but you can do what you're asking with sed 's/]*$//g' < sourceFile > destFile (1 Reply)
Discussion started by: oombera
1 Replies