Basic IF Command Question


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Basic IF Command Question
# 1  
Old 05-12-2011
Basic IF Command Question

Hi,

I have a months worth of data that I need to separate into weekly files. There is a date column with dates in the following format: YYYYMMDD.

I'm thinking I can create the weekly files by using a grep command combined with an IF command and specify each day of the specific week I'm extracting within the if command. Does this seem efficient? How would I set up the IF command?

cwl
# 2  
Old 05-12-2011
This is extraordinarily difficult because the data does not include the week number within the year.
It is much easier to group the data by Month or Month-Day within the Year.

If weeks are important we would need to know:
What Operating System and version you are running?
What Shell you prefer?
Whether this is forward-looking processing which can be changed to include the Week Number in the data or retrospective processing which needs to derive the week number from a date in a data file?

Week numbering is itself a contentious topic. Some detailed examples would help (particularly around the change of year).
Beware of the accountancy "week 53".
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Basic Linux command line question

:D:D:D These are list of command i typed on opensuse terminal and evolve lots of doubt around ,that i can't answer. COMMAND 1 linux-xavv:/ # cd COMMAND 2 linux-xavv:~ # Does above command 1 and command two with red labelled sign make different meaning or same . 1 linux-xavv:/... (1 Reply)
Discussion started by: lobsang
1 Replies

2. UNIX for Dummies Questions & Answers

Basic awk question...getting awk to act on $1 of the command itself

I have a script problem that I am not able to solve due my very limited understanding of unix/awk. This is the contents of test.sh awk '{print $1}' From the prompt if I enter: ./test.sh Hello World I would expect to see "Hello" but all I get is a blank line. Only then if I enter "Hello... (2 Replies)
Discussion started by: JasonHamm
2 Replies

3. Shell Programming and Scripting

basic nc question

i'm doing this in one terminal: nc -lu 7402 and it appears to start listening properly, then in another i do this: echo "hello" | nc -u localhost 7402 and nothing happens on the listening terminal - what am i doing wrong? thanks. (7 Replies)
Discussion started by: peterworth
7 Replies

4. Shell Programming and Scripting

basic question

hi, I have a basic question,, i am in a directory called /intas/OCU_3.9.1/sbin ocuut1@france>mv itsa_tcs itsa_tcs_old mv: itsa_tcs_old: rename: Permission denied i am logging as the owner of the file. when i am doing this i am getting the above error of permission denied. I know... (3 Replies)
Discussion started by: namishtiwari
3 Replies

5. HP-UX

Basic OS question

Could someone tell me the command to find out the OS version which will give 12 character not the 9 characters(which is usually machine id). uname -i gives machine id and uname -a is more comprehensive way to look. Thanks! (4 Replies)
Discussion started by: catwomen
4 Replies

6. Programming

q_zero question basic C

What am I doing wrong?... My code looks like this: #include <stdio.h> float answer; /* The result of our calculation */ int main() { answer = 1.0 / 3.0; printf(“The value of 1/3 is %f\n”, answer); return (0); } ==============================END And this is... (4 Replies)
Discussion started by: gumigecko
4 Replies

7. UNIX for Dummies Questions & Answers

Really basic question....

Hello all. Let me start off by saying I know a little more then it seems by me asking this question... here goes I have an old 486 box and I want to start messing around with unix. I've been taking classes for 3 or 4 years in c programming in unix, so I am used to the commands and such, but I... (1 Reply)
Discussion started by: robherms
1 Replies

8. UNIX for Dummies Questions & Answers

Very Basic Question

How to know if my AIX 5.2 is running at 64bits? THANKS (5 Replies)
Discussion started by: GermanSkull
5 Replies

9. UNIX for Dummies Questions & Answers

basic question

hey...when i type who...what does "pts" field mean??? eg pts 0 etc (1 Reply)
Discussion started by: urwannabefriend
1 Replies

10. UNIX for Dummies Questions & Answers

basic question

I have some basic doubts. Can someone clarify in this forum? 1)if then eval ' tset -s -Q -m ':?hp' ' else eval ' tset -s -Q ' what does it exactly mean in .profile? 2) what are 'nobody' and 'noaccess' usernames in /etc/passwd file. ... (3 Replies)
Discussion started by: asutoshch
3 Replies
Login or Register to Ask a Question