Matching the header of a .CSV file with dynamic field names
I have a .CSV file (frequency - weekly) whose header contains the year-week value in two of the columns which keeps changing every week. For an instance please see below.
I have to check if the data is placed under the right column and then proceed loading that data into the datamart. I created a standard header to compare it with the header of this file, but due to the dynamic nature of the field 14 and 15, I am not able to match the header every week. There is no date in the field name and I cannot use sysdate. Could you please suggest me how can I achieve this either using cat/awk/sed or any wildcards? Also let me know if you need more information.
I have a csv file which has no header. the file has 15 fields and needs to go out with a header of 8 fields.
The header content needs to have some variables and some fixed that i have set up:
variable header fields
OUTFILE_YEAR=`date '+%y'`
DATE=`date '+%d%m%y'`
TIME=`date '+%H:%M:%S'`... (6 Replies)
Hi,
I create a csv file and the output looks like below
Arun,E001
Sathish,E003
Now i need to include the below header and the output should like below
Name,Number
Arun,E001
Sathish,E003
Please guide me.
Thanks (4 Replies)
I have about 20 CSV's that all look like this:
"","","","","","","","","","","","","","","",""What I've been told I need to produce is the exact same thing, but with each file now containing the start_code from every other file where the email matches.
It doesn't matter if any of the other... (1 Reply)
Hi,
I am trying to add a header record to all the .csv files in a directory.
I am using the below sed commnad
sed -i '1 i \abc,sam,xyz,tip,pep,rip' xyz.csv
but this is not adding the header and I am not getting any error,pls tell me if any thing is wrong in the code.
Thanks,
Shruthi (2 Replies)
Friends,
I need help with the following in UNIX.
Merge all csv files in one folder considering only 1 header row and ignoring header of all other files.
FYI - All files are in same format and contains same headers.
Thank you (4 Replies)
Dear List,
I have a file of csv data which has a different line per compliance check per host. I do not want any omissions from this csv data file which looks like this:
date,hostname,status,color,check
02-03-2012,COMP1,FAIL,Yellow,auth_pass_change... (3 Replies)
Hi All,
Could anyoone please let me know how do I get sqlplus column header once in csv file
Scripts are below:
cat concreq.sh
#!/bin/bash
. $HOME/.profile
while ; do
sqlplus apps/pwd <<-EOF
set lines 100 pages 100
col "USER_CONCURRENT_QUEUE_NAME" format a40;
--set termout off... (5 Replies)
I have a .CSV file (file.csv) whose data are all enclosed in double quotes. Sample format of the file is as below:
column1,column2,column3,column4,column5,column6, column7, Column8, Column9, Column10
"12","B000QRIGJ4","4432","string with quotes, and with a comma, and colon: in... (3 Replies)
Hi,
I have a file of csv data, which looks like this:
file1:
1AA,LGV_PONCEY_LES_ATHEE,1,\N,1,00020460E1,0,\N,\N,\N,\N,2,00.22335321,0.00466628
2BB,LES_POUGES_ASF,\N,200,200,00006298G1,0,\N,\N,\N,\N,1,00.30887539,0.00050312... (10 Replies)
Hi Folks,
I have a requirement to develop a shell script. PFB my requirement,
Requirement:
I need to check an empty line after the end of each header in respective file and if a empty line is present simply echo file OK and if empty line is not present echo "Adding empty line" and add an... (6 Replies)
Discussion started by: tpk
6 Replies
LEARN ABOUT PHP
intlcalendar.getminimaldaysinfirstweek
INTLCALENDAR.GETMINIMALDAYSINFIRSTWEEK(3) 1 INTLCALENDAR.GETMINIMALDAYSINFIRSTWEEK(3)IntlCalendar::getMinimalDaysInFirstWeek - Get minimal number of days the first week in a year or month can have
Object oriented style
SYNOPSIS
public int IntlCalendar::getMinimalDaysInFirstWeek (void )
DESCRIPTION
Procedural style
int intlcal_get_minimal_days_in_first_week (IntlCalendar $cal)
Returns the smallest number of days the first week of a year or month must have in the new year or month. For instance, in the Gregorian
calendar, if this value is 1, then the first week of the year will necessarily include January 1st, while if this value is 7, then the week
with January 1st will be the first week of the year only if the day of the week for January 1st matches the day of the week returned by
IntlCalendar.getFirstDayOfWeek(3); otherwise it will be the previous years last week.
PARAMETERS
o $cal
- The IntlCalendar resource.
RETURN VALUES
An int representing a number of days or FALSE on failure.
EXAMPLES
Example #1
IntlCalendar.getMinimalDaysInFirstWeek(3)
<?php
ini_set('date.timezone', 'UTC');
ini_set('intl.default_locale', 'en_US');
$cal = new IntlGregorianCalendar(2013, 0 /* January */, 2);
var_dump(IntlDateFormatter::formatObject($cal, 'cccc')); // Wednesday
var_dump($cal->getMinimalDaysInFirstWeek(), // 1
$cal->getFirstDayofWeek()); // 1 (Sunday)
// Week 1 of 2013
var_dump(IntlDateFormatter::formatObject($cal, "'Week 'w' of 'Y"));
$cal->setMinimalDaysInFirstWeek(4);
// Still Week 1 of 2013 (1st week has 5 days in the new year)
var_dump(IntlDateFormatter::formatObject($cal, "'Week 'w' of 'Y"));
$cal->setMinimalDaysInFirstWeek(6);
// Week 53 of 2012
var_dump(IntlDateFormatter::formatObject($cal, "'Week 'w' of 'Y"));
The above example will output:
string(9) "Wednesday"
int(1)int(1)string(14) "Week 1 of 2013"
string(14) "Week 1 of 2013"
string(15) "Week 53 of 2012"
PHP Documentation Group INTLCALENDAR.GETMINIMALDAYSINFIRSTWEEK(3)