print lines AFTER lines cointaining a regexp (or print every first and fourth line)
Hi all,
This should be very easy but I can't figure it out...
I have a file that looks like this:
I want to print every first and fourth line so that the output looks like this:
No matter what I try along the lines of
, I can't get it to work. I'm sure there is an easy to specify the printing of every first and fourth line only but for future reference, how would I specify "print lines after lines beginning with a plus sign?"
Thanks,
Kevin
---------- Post updated at 08:34 PM ---------- Previous update was at 08:14 PM ----------
Good Day,
Im new to scripting especially awk and sed. I just would like to ask help from you guys about a sed command that prints the line immediately after a regexp, but not the line containing the regexp.
sed -n '/regexp/{n;p;}' filename
What if my regexp is 3 word or a sentence. Im... (3 Replies)
Hello
I have a silly question. I need to grep a match in text file
and then print 5 lines after it.
grep -A 5 .... do it.
OK
The next thing I can not handle is I need each output to be on 1 line
match line2 line3 line4 line5
match line2 line3 line4 line5
etc..
I will really... (10 Replies)
I am on a Solaris 10 x86 system
sample code
before3
before2
before1
group
after1
after2
after3
I want to grab the second line above my regexp
regexp=group
I want to grab ONLY the before2 line
I have numerous sed and awk ways of grabbing X line below the regexp, but no luck... (1 Reply)
Hi,
Anyone help me to print the lines from the flat file between 879th line number and 1424th line number.
The 879 and 1424 should be passed as input to the shell script(It should be dynamic).
Can any one give me using sed or awk?
I tried using read, and print the lines..Its taking too... (3 Replies)
Hi,
I have a file, say files_list, as below (o/p of ls -R cmd)
$ cat files_list
/remote/dir/path/to/file:
sub-dir1
sub-dir2
sub-dir3
...
/remote/dir/path/to/file/sub-dir1:
remote_file1.csv.tgz
<blank line 1>
/remote/dir/path/to/file/sub-dir2:
remote_file2.csv.tgz
<blank... (3 Replies)
Hi All
I'm trying to extract the line just above a regexp and all lines after this.
I'm currently doing this in two steps
sed -n -e "/^+---/{g;p;}" -e h oldfile.txt > modified.txt
sed -e "1,/^+---/d" -e "/^$/d" oldfile.txt >>modified.txt
Sample
sometext will be here
sometext will be... (3 Replies)
Hi all,
i need help to extract each first line from multiple lines occurrences based on different patterns (name) starting from the fourth lines like follows:-
// header 1 header 2 header 3
// no acc name score rank
//... (2 Replies)
Hi All,
I have a file looks like:
rst:singh:99.0.20-X86 2 rst:ACSI_SIN_SERVICES
rst:singh:99.0.20-X86 2 rst:ACSI_BISI want to wrap 3rd col in one line and add variable value at start and ending of line and I wrote command:
cat file | awk '{print $3}' | xargs > command.txt
sed -e... (1 Reply)
I have a directory of files, I can show the number of lines in each file and order them from lowest to highest with:
wc -l *|sort
15263 Image.txt
16401 reference.txt
40459 richtexteditor.txt
How can I also print the number of unique lines in each file?
15263 1401 Image.txt
16401... (15 Replies)
Discussion started by: spacegoose
15 Replies
LEARN ABOUT DEBIAN
castor_limits
LCG_LIMITS(4) File Formats LCG_LIMITS(4)NAME
Castor_limits - LCG internal limits
SYNOPSIS
#include <Castor_limits.h>
DESCRIPTION
The Castor_limits.h header file contains all the common limits that all LCG subpackages have to respect.
These are:
CA_MAXACLENTRIES
maximum number of ACL entries for a file/dir
Default value: 300
CA_MAXCLASNAMELEN
maximum length for a fileclass name
Default value: 15
CA_MAXCOMMENTLEN
maximum length for user comments in metadata
Default value: 255
CA_MAXDENFIELDS
maximum number of density values in devinfo
Default value: 8
CA_MAXDENLEN
maximum length for a alphanumeric density
Default value: 8
CA_MAXDGNLEN
maximum length for a device group name
Default value: 6
CA_MAXDPMTOKENLEN
maximum length for a Disk Pool Manager token
Default value: 36
CA_MAXDVNLEN
maximum length for a device name
Default value: 63
CA_MAXDVTLEN
maximum length for a device type
Default value: 8
CA_MAXFIDLEN
maximum length for a fid (DSN)
Default value: 17
CA_MAXFSEQLEN
maximum length for a fseq string
Default value: 14
CA_MAXGID
maximum value for gid
Default value: 0x7FFFFFFF
CA_MAXGRPNAMELEN
maximum length for a group name
Default value: 2
CA_MAXGUIDLEN
maximum length for a guid
Default value: 36
CA_MAXHOSTNAMELEN
maximum length for a hostname
Default value: 63
CA_MAXLBLTYPLEN
maximum length for a label type
Default value: 3
CA_MAXLINELEN
maximum length for a line in a log
Default value: 1023
CA_MAXMANUFLEN
maximum length for a cartridge manufacturer
Default value: 12
CA_MAXMLLEN
maximum length for a cartridge media_letter
Default value: 1
CA_MAXMODELLEN
maximum length for a cartridge model
Default value: 6
CA_MAXNAMELEN
maximum length for a pathname component
Default value: 255
CA_MAXNBDRIVES
maximum number of tape drives per server
Default value: 32
CA_MAXPATHLEN
maximum length for a pathname
Default value: 1023
CA_MAXPOLICYLEN
maximum length for a policy name
Default value: 15
CA_MAXPOOLNAMELEN
maximum length for a pool name
Default value: 15
CA_MAXPROTOLEN
maximum length for a protocol name
Default value: 7
CA_MAXRBTNAMELEN
maximum length for a robot name
Default value: 17
CA_MAXRECFMLEN
maximum length for a record format
Default value: 3
CA_MAXREGEXPLEN
maximum length for a regular expression
Default value: 63
CA_MAXSFNLEN
maximum length for a replica
Default value: 1103
CA_MAXSHORTHOSTLEN
maximum length for a hostname without domain
Default value: 10
CA_MAXSNLEN
maximum length for a cartridge serial nb
Default value: 24
CA_MAXSTGRIDLEN
maximum length for a stager full request id
(must be >= nb digits in
CA_MAXSTGREQID + CA_MAXHOSTNAMELEN + 8)
Default value: 77
CA_MAXSTGREQID
maximum value for a stager request id
Default value: 999999
CA_MAXUID
maximum value for uid
Default value: 0x7FFFFFFF
CA_MAXSYMLINKS
maximum number of symbolic links
Default value: 5
CA_MAXTAGLEN
maximum length for a volume tag
Default value: 255
CA_MAXTAPELIBLEN
maximum length for a tape library name
Default value: 8
CA_MAXUNMLEN
maximum length for a drive name
Default value: 8
CA_MAXUSRNAMELEN
maximum length for a login name
Default value: 14
CA_MAXVIDLEN
maximum length for a VID
Default value: 6
CA_MAXVSNLEN
maximum length for a VSN
Default value: 6
AUTHOR
LCG Grid Deployment Team
LCG $Date: 2007/02/03 11:16:45 $ LCG_LIMITS(4)