Home | Contact Us | Sitemap
DWHlabs provides Data Warehouse education services.This web portal is very useful to the Database professionals,
Data Warehouse professionals, UNIX professionals etc.,
  About Us Advertise Support us Tell your Fren Testimonial Contact Us  
 
 
Please help us continue development of this website and it's services!
 
 

 


 
UNIX Lab -15 DAYS TUTORIAL - EIGTH DAY
Sponsered Links
 
 
 
 
 
 
 
  Filter Commands
   

$ cut :: This command is used to retreive the required fields or characters from a file.

100 Rakesh UNIX HYD
101 Ramani C++ CHE
102 Prabhu C BAN
103 Jyosh DWH CHE

syntax - $cut -f 1-3 filename
eg. $cut -f 0-2 employee (all the fields in the above file)

100 Rakesh UNIX
101 Ramani C++
102 Prabhu C
103 Jyosh DWH


eg. $cut -c 1-8 employee (first 8 characters)

100 Rake
101 Rama
102 Prab
103 Jyos

Delimeters

Default ( Tab )
: , ; * _

$cut options

$cut -f 0-2 employee
$cut -c 1-8 employee
$cut -d ',' 1-8 employee

$ sort :: This command is used to sort the file records in ascending or descending

$sort Options

$sort -r filename (reverse)
$sort -u filename (unique records)
$sort -n filename(show the number along sorting)

How to sort data in field wise ?

syntax- $sort -f +pos1 -pos2 filename
eg. $sort -f +1 -2 employee

$ uniq :: This command is used to filter the duplicate lines from a file
Note :: Always the file must be in sorting order.

syntax - $uniq filename
eg. $uniq employee

$uniq Options

eg. $uniq -u employee (displays non duplicated lines)
eg. $uniq -d employee ( displays duplicated lines)

Question ::

Q) How to remove duplicate lines in a file?
A) $uniq employee>temp
$mv temp employee

 
DWH 3Colors
CERTIFICATION GUIDE
DATA DICTIONARY
ALL ARTICLES
   
Data Warehouse Lab

- ETL TOOL
INFORMATICA
OTHER TOOLS

- REPORTING TOOL

BUSINESS OBJECTS
OTHER TOOLS

Database Lab

- ORACLE
SQL
PL/SQL

- DB2
OTHER TOOLS

Unix Lab

Project Lab

DWH Schools

Books Store



 
  About Us Advertise Support us Tell your Fren Testimonial Contact Us  
© 2008 DWHlabs
Privacy Policy | Terms & Conditions