10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi,
In an ideal scenario, I will have a listing of db transaction log that gets copied to a DR site and if I have them all, they will be numbered consecutively like below.
1_79811_01234567.arc
1_79812_01234567.arc
1_79813_01234567.arc
1_79814_01234567.arc
1_79815_01234567.arc... (3 Replies)
Discussion started by: newbie_01
3 Replies
2. Shell Programming and Scripting
Hi
I am getting an argument which specifies the range of numbers. eg: 7-15
Is there a way that i can easily (avoiding loop) print the range of number between and including the specified above.
The above example should translate to 7,8,9,10,11,12,13,14,15 (3 Replies)
Discussion started by: tostay2003
3 Replies
3. Shell Programming and Scripting
Hi Guru's,
I am trying to grep a range of line numbers (based on match) and then look for another match which starts with a special character '$' and print the line number. I have the below code but it is actually printing the line number counting starting from the first line of the range i am... (15 Replies)
Discussion started by: Kevin Tivoli
15 Replies
4. Shell Programming and Scripting
The following text is in testFile.txt:
one 5
two 10
three 15
four 20
five 25
six 10
seven 35
eight 10
nine 45
ten 50
I'd like to use sed to print the first occurance of search pattern /10/ in a given range. This command is to be run against large log files, so to optimize efficiency,... (9 Replies)
Discussion started by: uschaafm
9 Replies
5. UNIX for Dummies Questions & Answers
We have C shell and we are executing the below script:
#!/bin/csh -f
if ($#argv != 2) then
echo "Usage $0 DirecotryPath Inputfilename"
exit 1
endif
set dir=$1
set fname=$2
echo $dir
foreach line ( `cat $fname` )
echo \ ======================================== >>... (2 Replies)
Discussion started by: donisback
2 Replies
6. Shell Programming and Scripting
Hi,
I have a file as below
This is the line one
This is the line two
<\XMLTAG>
This is the line three
This is the line four
<\XMLTAG>
Output of the SED command need to be as below.
This is the line one
This is the line two
<\XMLTAG>
Please do the need to needful to... (4 Replies)
Discussion started by: RMN
4 Replies
7. Shell Programming and Scripting
Hi all,
on Solaris 10, I'd like to print a range of lines starting at pattern but also including the very first line before pattern.
the following doesn't print the range starting at pattern and going down to the end of file: cat <my file> | sed -n -e '/<pattern>{x;p;}/'
I need to include the... (1 Reply)
Discussion started by: siriche
1 Replies
8. Shell Programming and Scripting
Hi ,
I have a file content like following. In few lines I have fields with '"' and in few not.
"Country" character varying(150),
"Region" character varying(60),
"Total Page Requests" numeric,
"Pages Served" numeric,
"Ad request" numeric,
Ads Served ... (5 Replies)
Discussion started by: sussus2326
5 Replies
9. Shell Programming and Scripting
Howdy experts,
We have some ranges of number which belongs to particual group as below.
GroupNo StartRange EndRange
Group0125 935300 935399
Group2006 935400 935476
937430 937459
Group0324 935477 935549
... (6 Replies)
Discussion started by: thepurple
6 Replies
10. Shell Programming and Scripting
Ok, so I get that:
sed -n '/START/,/END/p' file
...will print every line from START to END inclusive, but I don't want to see START or END. Apart from the obious:
sed -n '/START/,/END/p' file | grep -v "START" | grep -v "END"
...is there a simpler way of doing this?
Thanks as always! (2 Replies)
Discussion started by: cs03dmj
2 Replies