There are a number of different types of CSV files i.e. a,b,c , "a","b","c" , etc.
Here is an example of changing the second field of a CSV file without quotes
Here is an example of changing the second field of a CVS file with double quotes
I need to converts a CSV file from Format "A" into Format "B", where the first field is repeated in a loop with a counter. I'am quite sure that this is with AWK possible burt the "Forum Search Function" doesn't work at the moment.
Format "A"
A1;B1
;B2
;B3
A2;C1
;C2
;C3
... (2 Replies)
#!/bin/bash
i=0
cat 1.csv | while read fileline
do
echo "$fileline"
IFS="#" flds=( $fileline )
nrofflds=${#flds}
echo "noof fields$nrofflds"
fld=0
while
do
echo "noof counter$fld"
echo "$nrofflds"
#fld1="${flds}" trying to store the content of line to fields but i... (4 Replies)
SHELL SCRIPT
Hi,
I have 3 separate files within a folder. Every File contains data in a single column like
File1 contains data
mayank
sushant
dheeraj
File2 contains
DSA_AT
MG_AT
FLAT_09
File3 contains data
123123
232323 (2 Replies)
Hi,
I have a requirment where I need to pull different columns from a .csv file.
Here is the sample of the csv file.
account,item,flag1,flag2,flag3,flag4,flag5,......feed,tran
I will be have a config.txt file which will have the following information.
item,flag5,flag10,feed,tran... (2 Replies)
Hi,
i have csv input file looks like below
3rd field is date and time field i want to change it with user supplied date and time says
year=2011
month=09
day=05
hour=11
count=2
when count is say 10 then first ten records should pick and it should increment the... (2 Replies)
Hi All,
I want to remove the rows from File1.csv by comparing the columns/fields in the File2.csv. I only need the records whose first column is same and the second column is different for the same record in both files.Here is an example on what I need.
File1.csv:
RAJAK|ACTIVE|1... (2 Replies)
Hello
I have a csv file which I need to insert addtional commas into. The csv is of the format
field1,field2,field3,field4,...etc...,field13,field14
I need to add extra commas in each record so that the final output looks like
... (1 Reply)
hi
I have a csv file with few rows
> cat job_stat
1,jobname1,somthing,somthing
2,jobname2,somthing,somthing
3,jobname3,somthing,somthing
4,jobname4,somthing,somthing
I want to add few columns after the 2nd column and then append rest of the columns after the 3rd newly added... (3 Replies)
I have a csv file which is produced out of a SED command sed 's/|/","/g; s/^/"/; s/$/"/' A4.txt > A5.csv and I need either an addition to the SED command or a separate command to convert the following characters which occur within the fields in multiple lines
1) "=" to ="
and
2)""~ to " (4 Replies)
I'm trying to use awk to count the occurrences of two matching fields of a CSV file.
For instance, for data that looks like this...
Joe,Blue,Yes,No,High
Mike,Blue,Yes,Yes,Low
Joe,Red,No,No,Low
Joe,Red,Yes,Yes,Low
I've been trying to use code like this...
countvar=`awk ' $2~/$color/... (4 Replies)
Discussion started by: nmoore2843
4 Replies
LEARN ABOUT LINUX
timerclear
TIMERADD(3) Linux Programmer's Manual TIMERADD(3)NAME
timeradd, timersub, timercmp, timerclear, timerisset - timeval operations
SYNOPSIS
#include <sys/time.h>
void timeradd(struct timeval *a, struct timeval *b,
struct timeval *res);
void timersub(struct timeval *a, struct timeval *b,
struct timeval *res);
void timerclear(struct timeval *tvp);
int timerisset(struct timeval *tvp);
int timercmp(struct timeval *a, struct timeval *b, CMP);
Feature Test Macro Requirements for glibc (see feature_test_macros(7)):
All functions shown above: _BSD_SOURCE
DESCRIPTION
The macros are provided to operate on timeval structures, defined in <sys/time.h> as:
struct timeval {
time_t tv_sec; /* seconds */
suseconds_t tv_usec; /* microseconds */
};
timeradd() adds the time values in a and b, and places the sum in the timeval pointed to by res. The result is normalized such that
res->tv_usec has a value in the range 0 to 999,999.
timersub() subtracts the time value in b from the time value in a, and places the result in the timeval pointed to by res. The result is
normalized such that res->tv_usec has a value in the range 0 to 999,999.
timerclear() zeros out the timeval structure pointed to by tvp, so that it represents the Epoch: 1970-01-01 00:00:00 +0000 (UTC).
timerisset() returns true (nonzero) if either field of the timeval structure pointed to by tvp contains a nonzero value.
timercmp() compares the timer values in a and b using the comparison operator CMP, and returns true (nonzero) or false (0) depending on the
result of the comparison. Some systems (but not Linux/glibc), have a broken timercmp() implementation, in which CMP of >=, <=, and == do
not work; portable applications can instead use
!timercmp(..., <)
!timercmp(..., >)
!timercmp(..., !=)
RETURN VALUE
timerisset() and timercmp() return true (nonzero) or false (0).
ERRORS
No errors are defined.
CONFORMING TO
Not in POSIX.1-2001. Present on most BSD derivatives.
SEE ALSO gettimeofday(2), time(7)COLOPHON
This page is part of release 3.27 of the Linux man-pages project. A description of the project, and information about reporting bugs, can
be found at http://www.kernel.org/doc/man-pages/.
Linux 2010-02-25 TIMERADD(3)