Sponsored Content
Top Forums Shell Programming and Scripting Sort, sed, and zero padding date column csv bash scripting Post 302834893 by sean1357 on Saturday 20th of July 2013 01:43:37 PM
Old 07-20-2013
It works. Thank you very muh for your help. Now, I having another problem how to remove row from range date.

range from 04/01/2010 - 05/04/2013, but the problem is that 04/01/2010 or 05/04/2013 maybe doesn't existed in csv file. Is the a way that you just compare date of input?

Example:
Code:
1,2,3,4,5,6,03/02/2009,8   -> need to remove column
1,2,3,4,5,6,08/03/2009,8   -> need to remove column
1,2,3,4,5,6,04/01/2010,8   -> keep from here
....
....
1,2,3,4,5,6,05/01/2013,8   -> keep to end
1,2,3,4,5,6,05/11/2013,9  -> need to remove from this point

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to insert a sequence number column inside a pipe delimited csv file using shell scripting?

Hi All, I need a shell script which could insert a sequence number column inside a dat file(pipe delimited). I have the dat file similar to the one as shown below.. |A|B|C||D|E |F|G|H||I|J |K|L|M||N|O |P|Q|R||S|T As shown above, the column 4 is currently blank and i need to insert sequence... (5 Replies)
Discussion started by: nithins007
5 Replies

2. UNIX for Dummies Questions & Answers

Sort csv file by duplicated column value

hello, I have a large file (about 1gb) that is in a file similar to the following: I want to make it so that I can put all the duplicates where column 3 (delimited by the commas) are shown on top. Meaning all people with the same age are listed at the top. The command I used was ... (3 Replies)
Discussion started by: jl487
3 Replies

3. Shell Programming and Scripting

Sort data by date and then search by column

Hi, I have a file where data is pipe separated.First i want to sort the file content by date . Then i want to pick up the records based on the first column which should be unique and not have duplicates. NYSE|yyyrrrddd|toronto|isin|ticker|2013-05-15... (2 Replies)
Discussion started by: samrat dutta
2 Replies

4. Shell Programming and Scripting

Padding a csv value with 0's

I have this csv file that I would like to sort on the 20th and 21st field. They are high lighted below. My challenge is that when I sort on those fields they are not in order as I would have liked. It seems like I have to pad those fields to the longest value in that fields data. ... (6 Replies)
Discussion started by: GroveTuckey
6 Replies

5. Shell Programming and Scripting

sed --> sort data by date

Hi, i "tried" to sort data by date. So far, i used sed to take the data from the last and the actual month. Now, after changing the year it is not working properly. i use: GNU bash, version 4.2.45(1)-release (x86_64-suse-linux-gnu) sed -n '/\//p' $Home/../scripte/pd_0.txt y is a... (6 Replies)
Discussion started by: IMPe
6 Replies

6. Shell Programming and Scripting

Bash - delete from csv all the row if the first column is length >

Hi guys, i have a csv file like: USERID;COG;DESCR;FIL;OFF user001;user;test1;001;A01 user002;user;test2;002;A02 user0003;user;test3;003;A03 user004;user;test4;004;A04 user0005;user;test5;005;A05 etc.. I need to read line for line and, if value of first column is > 7 char (in this example... (4 Replies)
Discussion started by: kamose
4 Replies

7. Shell Programming and Scripting

Need a piece of shell scripting to remove column from a csv file

Hi, I need to remove first column from a csv file and i can do this by using below command. cut -f1 -d, --complement Mytest.csv I need to implement this in shell scripting, Whenever i am using the above command alone in command line it is working fine. I have 5 files in my directory and... (3 Replies)
Discussion started by: Samah
3 Replies

8. Shell Programming and Scripting

Get maximum per column from CSV file, based on date column

Hello everyone, I am using ksh on Solaris 10 and I'm gathering data in a CSV file that looks like this: 20170628-23:25:01,1,0,0,1,1,1,1,55,55,1 20170628-23:30:01,1,0,0,1,1,1,1,56,56,1 20170628-23:35:00,1,0,0,1,1,2,1,57,57,2 20170628-23:40:00,1,0,0,1,1,1,1,58,58,2... (6 Replies)
Discussion started by: ejianu
6 Replies

9. Shell Programming and Scripting

Csv files sort by date and zip monthly

Hi, I'm an absolute beginner in shell programming. I would need a script for a NAS that makes the csv files sorted by date and always monthly a zip. In the current month, the data should be integrated into this folder, so there are only monthly files. Thanks for your help (1 Reply)
Discussion started by: Pipo
1 Replies

10. UNIX for Beginners Questions & Answers

How to sort a column in excel/csv file?

I have to sort the 4th column of an excel/csv file. I tried the following command sort -u --field-separator=, --numeric-sort -k 2 -n dinesh.csv > test.csv But, it's not working. Moreover, I have to do the same for more than 30 excel/csv file. So please help me to do the same. (6 Replies)
Discussion started by: dineshkumarsrk
6 Replies
W2DO(1) 						User Contributed Perl Documentation						   W2DO(1)

NAME
w2do - a simple text-based todo manager SYNOPSIS
w2do [-l] [-t task] [-g group] [-d date] [-p priority] [-f|-u] w2do -a task [-g group] [-d date] [-p priority] [-f|-u] w2do -c id [-t task] [-g group] [-d date] [-p priority] [-f|-u] w2do -r id w2do [options] DESCRIPTION
w2do is a simple to use yet efficient command-line todo manager written in Perl. OPTIONS
General Options -l, --list Display items in the task list. All tasks are listed by default, but desired subset can be easily selected via specifying options as well. Since listing is the default action, this option can be safely omitted. -a task, --add task Add new item with selected task name to the task list. When no additional specifying options are given, the group general, the due date anytime and the priority 3 is used by default and the task is marked as unfinished. -c id, --change id Change item with selected id in the task list. Further specifying options are required in order to take any effect. -r id, --remove id Remove item with selected id from the task list. --change-group group Change all items in the selected group. Further specifying options are required in order to take any effect. --remove-group group Remove all items from the selected group. --purge-group group Remove all finished items from the selected group. --change-date date Change all items with selected due date. Further specifying options are required in order to take any effect. --remove-date date Remove all items with selected due date. --purge-date date Remove all finished items with selected due date. --change-pri priority Change all items with selected priority. Further specifying options are required in order to take any effect. --remove-pri priority Remove all items with selected priority. --purge-pri priority Remove all finished items with selected priority. --change-old Change all items with passed due date. Further specifying options are required in order to take any effect. --remove-old Remove all items with passed due date. --purge-old Remove all finished items with passed due date. --change-all Change all items in the task list. Further specifying options are required in order to take any effect. --remove-all Remove all items from the task list. --purge-all Remove all finished items from the task list. --undo Revert last action. When invoked, the data are restored from the backup file (i.e. "~/.w2do.bak" by default), which is deleted at the same time. --groups Display comma-delimited list of all groups in the task list. --stats Display detailed task list statistics. -h, --help Display help message and exit. -v, --version Display version information and exit. Specifying Options -t task, --task task Specify the task name. -g group, --group group Specify the group name. The group name should be a single word with maximum of 10 characters, but longer names are shortened automatically. -d date, --date date Specify the due date. Available options are anytime, today, yesterday, tomorrow, month, year, or an exact date in the YYYY-MM-DD format, e.g. 2008-06-17 for 17 June 2008. -p priority, --priority priority Specify the priority. Available options are integers between 1 and 5, where 1 represents the highest priority. -f, --finished Specify the finished task. -u, --unfinished Specify the unfinished task. Additional Options -s file, --savefile file Use selected file instead of the default "~/.w2do" as a save file. -w width, --width width Use selected line width; the minimal value is 75. -q, --quiet Avoid displaying messages that are not necessary. -V, --verbose Display all messages; this is the default option. -C, --colour, --color Use coloured output instead of the default plain text version. -X, --no-colour, --no-color Use plain text output (no colours); this is the default option. -b, --bare Do not display table header and group separators. -B, --no-bare Display table header and group separators; the default option. -I, --no-id Do not display ID column in the listing. --with-id Display ID column in the listing; the default option. -G, --no-group Do not display group column in the listing. --with-group Display group column in the listing; the default option. -D, --no-date Do not display due date column in the listing. --with-date Display due date column in the listing; the default option. -P, --no-priority Do not display priority column in the listing. --with-priority Display priority column in the listing; the default option. -S, --no-state Do not display state column in the listing. --with-state Display state column in the listing; the default option. ENVIRONMENT
W2DO_SAVEFILE Use selected file instead of the default "~/.w2do" as a save file. W2DO_WIDTH Use selected line width; the minimal value is 75. FILES
~/.w2do Default save file. ~/.w2do.bak Default backup file. SEE ALSO
w2html(1), w2text(1), perl(1). BUGS
To report bugs or even send patches, you can either add new issue to the project bugtracker at <http://code.google.com/p/w2do/issues/>, visit the discussion group at <http://groups.google.com/group/w2do/>, or you can contact the author directly via e-mail. AUTHOR
Written by Jaromir Hradilek <jhradilek@gmail.com>. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.3 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included as a file called FDL in the main directory of the w2do source package. COPYRIGHT
Copyright (C) 2008, 2009, 2010 Jaromir Hradilek This program is free software; see the source for copying conditions. It is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. Version 2.3.1 2010-02-13 W2DO(1)
All times are GMT -4. The time now is 12:39 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy