Sponsored Content
Top Forums Shell Programming and Scripting Creating a range out of a broken list Post 302326883 by Franklin52 on Friday 19th of June 2009 05:31:00 AM
Old 06-19-2009
Something like this?

Code:
awk 'NR < 7 || (NR > 8 && NR <16) || (NR > 22 && NR < 27)' file

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

to get list of files of a perticular range of time

hi, how to list the files which has been created or accessed before 6 months thanks (1 Reply)
Discussion started by: useless79
1 Replies

2. UNIX for Dummies Questions & Answers

How to list file names in a certain date range using ls command?

Hi experts, I Need to print file names in a certain date range using ls:confused:. Please help me with any sample script. Thanks a lot in advance. Regards, Satish (4 Replies)
Discussion started by: satish.vutti
4 Replies

3. UNIX for Dummies Questions & Answers

List-to-Range of Numbers

Hello, I have two columns with data that look like this: Col1 Col2 ------ ----- a 1 a 2 a 3 a 4 a 7 a 8 a 9 a 10 a 11 b 6 b 7 b 8 b 9 b 14 (5 Replies)
Discussion started by: Gussifinknottle
5 Replies

4. Shell Programming and Scripting

Create range from a list

Hello everyone, I am trying to create a script that will make a range or ranges based on a sorted list of numbers. Eg. If the list is like 1 2 3 4 5 6 7 12 13 14 15 The output range should be: 1-7 12-15 (9 Replies)
Discussion started by: run_time_error
9 Replies

5. Shell Programming and Scripting

List/Range Todays Log.

Hi All, I am mediator Shell programmer, Just have an hands on experice :-), i am writing a shell scirpt to list logs of todays date from /var/log/messages. I need to ur kind help where if i run this script from cron. the script should filter todays logs only from /var/log/messages. Below... (4 Replies)
Discussion started by: anand.kulkarni
4 Replies

6. Shell Programming and Scripting

List files with Date Range and Zip it

Hi all, I am using the below script which display the files in the folder with the date range we specify. I want to add extra functionality that, The listing files should be zipped using gzip. I tried to add exec gzip at the last line but it is not working. Suggestions please. ... (2 Replies)
Discussion started by: nokiak810
2 Replies

7. Shell Programming and Scripting

Using 'date' to list a range of dates

Hi guys, I have been trying to create a list of dates from a certain range, ie. range from 01011950 to 31122000 But when my below code reaches certain dates, it comes up with a; 'date: invalid date 'yyyy-mm-dd -d 1day' Sofar I have come up with the following, slow and ugly; ... (4 Replies)
Discussion started by: TAPE
4 Replies

8. UNIX for Dummies Questions & Answers

Creating a column based list from a string list

I have a string containing fields separated by space Example set sr="Fred Ted Joe Peter Paul Jean Chris Tim Tex" and want to display it in a column format, for example to a maximum of a window of 100 characters And hopefully display some thing like Fred Ted Joe ... (3 Replies)
Discussion started by: kristinu
3 Replies

9. Shell Programming and Scripting

Convert list of numbers to text range

Hi, I'd like to take a list of numbers (with a prefix) and convert to a range, for example: cn001 cn004 cn016 cn017 cn018 cn019 cn020 cn021 cn031 cn032 cn038 cn042 cn043 cn044 cn045 (5 Replies)
Discussion started by: chrissycc
5 Replies

10. UNIX for Beginners Questions & Answers

I need to find in a file a list of number where last two digit end in a range

I all I am tryng to find a way to sort a list of number in a file by the value of last two digit. i have a list like this 313202320388 333202171199 373202164587 393202143736 323202132208 353201918107 343201887399 363201810249 333201805043 353201791691 (7 Replies)
Discussion started by: rattoeur
7 Replies
OFFTIME(3)						   BSD Library Functions Manual 						OFFTIME(3)

NAME
offtime, timeoff, timegm, timelocal -- convert date and time LIBRARY
Standard C Library (libc, -lc) SYNOPSIS
#include <time.h> struct tm * offtime(const time_t * clock, long int offset); struct tm * offtime_r(const time_t * clock, long int offset, struct tm *ret); time_t timeoff(struct tm * tm, long int offset); time_t timegm(struct tm * tm); time_t timelocal(struct tm * tm); DESCRIPTION
These functions are inspired by C standard interfaces named similarly. offtime() converts the calendar time clock, offset by offset seconds, into broken-down time, expressed as Coordinated Universal Time (UTC). offtime_r() is similar to offtime() but it places the returned struct tm * in the user supplied ret argument. timeoff() converts the broken-down time tm, expressed as UTC, offset by offset seconds, into a calendar time value. timegm() converts the broken-down time tm into a calendar time value, effectively being the inverse of gmtime(3). It is equivalent to the C standard function mktime(3) operating in UTC. timelocal() converts the broken down time tm, expressed as local time, into a calendar time value. It is equivalent to the C standard func- tion mktime(3), and is provided for symmetry only. SEE ALSO
ctime(3), tm(3), tzset(3) BSD
April 14, 2011 BSD
All times are GMT -4. The time now is 02:14 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy