How to find the Day of the Week of the given Date using perl?
If I have a date in YYY--MM-DD format, how to find the DOW? Based on that, I need to find the following sunday.
Pls help. (5 Replies)
Hello,
I wanted to display the month for previous day date. Like, today date is 18-Nov-2008. So the previous date is 17-Nov-2008. The output should be November.
If the today date is 1-DEC-2008, then output should be NOVEMBER.
If the today date is 1-JAN-2008, then output should be DECEMBER.... (4 Replies)
Hi All,
I need to find the previous month last day minus one day, using shell script. Can you guys help me to do this.
My Requirment is as below:
Input for me will be 2000909(YYYYMM)
I need the previous months last day minus 1 day timestamp. That is i need 2000908 months last day minus ... (3 Replies)
Hi guys,
I had a scenario...
1. I had to get the previous days date in yyyymmdd format
2. i had to create a file with Date inthe format yyyymmdd.txt format
both are different
thanks guys in advance.. (4 Replies)
Hi,
I would like to write a script that checks if a file ('counter') was modified the previous day, if so erase its contents and write 00000000 into it.
For e.g. if the file 'counter' was last modified at 11.30pm on 24th May and the script runs at 12.15am of 25th May, it should erase it's... (1 Reply)
Hi All,
I have a requirement where I need to first capture the current day & move all the files from a particular directory based on a previous day.
i.e move all the files from one directory to another based on current day & a previous day. Here is what I am trying, but it gives me errors.... (2 Replies)
Ok, the title is confusing i know, but it is a weird question.
I have a bash script running on Centos5.8 and want to find a better way to do some date manipulation. What i am trying to do is get 3 days of files (day before, that day, and day after), concatenate the three files and pass them on... (2 Replies)
I have requirment to get last date of previous month and the first date of previous 4th month:
Example:
Current date: 20130320 (yyyymmdd)
Last date of previous month: 20130228 (yyyymmdd)
First date of previous 4th month: 20121101 (yyyymmdd)
In my shell --date, -d, -v switches are not... (3 Replies)
Hi Experts,
i am using the below code get the date of previous day.
#!/usr/bin/ksh
datestamp=`date '+%Y%m%d'`
yest=$((datestamp -1))
echo $yest
When i execute the code i am getting output as:
20130715
What i am trying here is, based on the date passed i am fetching previus day's... (0 Replies)
Legends,
i need to get previous day using date command.
Can you please help.
sdosanjh:/home> date +%m%d%y
011514
i tried -d '-1 day' but it is not working (5 Replies)
Discussion started by: sdosanjh
5 Replies
LEARN ABOUT DEBIAN
grass-pg
grass-pg(1grass) Grass User's Manual grass-pg(1grass)NAME
grass-pg - PostgreSQL driver
PostgreSQL driver PostgreSQL driver in GRASS The driver name is 'pg'.
Creating a PostgreSQL database
A new database is created with 'createdb', see the PostgreSQL manual for details.
Connecting GRASS to PostgreSQL
# example for connecting to a PostgreSQL server:
db.connect driver=pg database="host=myserver.osgeo.org,dbname=mydb"
# password is asked interactively if not specified:
db.login user=myname [pass=secret]
db.connect -p
db.tables -p
Supported SQL commands
All SQL commands supported by PostgreSQL. It's not possible to use C-like escapes (with backslash like
etc) within SQL syntax.
Operators available in conditions
All SQL operators supported by PostgreSQL.
Adding an unique ID column
Import vector module require an unique ID column which can be generated as follows in a PostgreSQL table:
echo "
ALTER TABLE mytable ADD ID integer;
CREATE SEQUENCE mytable_seq;
UPDATE mytabe SET ID = nextval('mytable_seq');
DROP SEQUENCE mytable_seq;
" | db.execute
Attribute Converters
CSV import into PostgreSQL:
h copy
COPY t1 FROM 'filename' USING DELIMITERS ',';
pg2xbase: DBF to PostgreSQL converter.
Geometry import from PostgreSQL table
v.in.db creates a new vector (points) map from a database table containing coordinates. See here for examples.
PostGIS: PostgreSQL with vector geometry
PostGIS: adds geographic object support to PostgreSQL.
Example: Import from PostGIS
In an existing PostGIS database, create the following table:
CREATE TABLE test
(
id serial NOT NULL,
mytime timestamp DEFAULT now(),
text varchar,
wkb_geometry geometry,
CONSTRAINT test_pkey PRIMARY KEY (id)
) WITHOUT OIDS;
# insert value
INSERT INTO test (text, wkb_geometry)
VALUES ('Name',geometryFromText('POLYGON((600000 200000,650000
200000,650000 250000,600000 250000,600000 200000))',-1));
# register geometry column
select AddGeometryColumn ('postgis', 'test', 'geometry', -1, 'GEOMETRY', 2);
GRASS can import this PostGIS polygon map as follows:
v.in.ogr dsn="PG:host=localhost dbname=postgis user=neteler" layer=test
output=test type=boundary,centroid
v.db.select test
v.info -t test
Geometry Converters
PostGIS with shp2pgsql:
shp2pgsql -D lakespy2 lakespy2 test > lakespy2.sql
e00pg: E00 to PostGIS filter, see also v.in.e00.
GDAL/OGR ogrinfo and ogr2ogr: GIS vector format converter and library, e.g. ArcInfo or SHAPE to PostGIS.
ogr2ogr -f "PostgreSQL" shapefile ??
SEE ALSO
db.connect, db.execute,
Database management in GRASS GIS,
Help pages for database modules,
SQL support in GRASS GIS
PostgreSQL web site,
pgAdmin graphical user interface
Book: PostgreSQL: Introduction and Concepts by Bruce Momjian
PostgreSQL Documentation
PostgreSQL Technical Documentation
GDAL/OGR PostgreSQL driver documentation
MapServer Wiki
Last changed: $Date: 2011-02-07 18:59:50 +0100 (Mon, 07 Feb 2011) $
Help Index
GRASS 6.4.2grass-pg(1grass)