Sponsored Content
Top Forums Shell Programming and Scripting awk parsing file to create a database Post 302969421 by freddie50 on Tuesday 22nd of March 2016 01:45:30 PM
Old 03-22-2016
awk parsing file to create a database

Hi Guys,

I have a list a hotels stored in many different text files.

This list is kept in the following format:

Code:
20/03
Hotel:
The Bear Hotel
Honey Street 
Woodstock
UK
Tel:+44-xxxxxx
Rate: 100

21/03
Hotel:
The Bush Hotel
Nice Street
Farnham
UK
Tel:+44-xxxxxx
Rate: 90

22/03
Hotel:
The Bear Hotel
Honey Street 
Woodstock
UK
Tel:+44-xxxxxx
Rate: 100

I would like to make a script (using awk) that parses all files containing this kind of data and that will produce an output file containing all hotels only once and sorted by towns.

Many thanks for your help and keep up the good work.
Cheers,
Fred

Last edited by Scrutinizer; 03-22-2016 at 03:09 PM.. Reason: code tags
freddie50
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

parsing file through awk

hi, how can i achieve this in awk CON Controllers Department R abcuser usernamedesc1 R defuser usernamedesc2 R ... (13 Replies)
Discussion started by: bbeugie
13 Replies

2. Shell Programming and Scripting

awk and file parsing

Hi, I have a input file like this TH2TH2867Y NOW33332106Yo You Baby TH2TH3867Y NOW33332106No Way Out TH2TH9867Y NOW33332106Can't find it TJ2TJ2872N WOW33332017sure thing alas TJ2TJ3872N WOW33332017the sky rocks TJ2TJ4872N WOW33332017nothing else matters ... (4 Replies)
Discussion started by: devtakh
4 Replies

3. Programming

parsing a database with java

hi all i have a databasewhich consists few fields in the form Time(starting from 0 in asc order) bytes service flags protocols e.g. 0, 0, 0, 56, 86 1, 524, 3, 6, 65 1, 624, 0, 43, 33 2, 72, 0, 43, 80 3, 26, 3, 6, 86 4, 323, 3, 1459, 95 5, 325, 3, 1459, 33 6, 225, 3, 1436, 57 now... (7 Replies)
Discussion started by: stuggler
7 Replies

4. Shell Programming and Scripting

Parsing a file with AWK

Input Group: Erecords: Copy: ADC R2: Replication volumes: Replication set: RSet 1 Replication size: 50.00GB SAN Info: 50.00GB DGC VRAID CX4-960 LUN 1040 (1040) 60,06,01,60,32,bb,21,00,84,a0,08,b1,da,ec,df,11... (2 Replies)
Discussion started by: greycells
2 Replies

5. Solaris

Can't create database after Oracle Database installation

I installed Oracle 10 software on Solaris 11 Express, everything was fine execpt I can't create database using dbca.rsp file. I populated file with following options. OPERATION_TYPE = "createDatabase" GDBNAME = "solaris_user.domain.com" SID = "solaris_user" TEMPLATENAME = "General... (0 Replies)
Discussion started by: solaris_user
0 Replies

6. Shell Programming and Scripting

Create database using Backup file

Hi, I have backup file of database in my server. I want to create a that database in the same Mysql Server. How can I do that? Please send the steps to create the database using backup file? Thanks a lot, (1 Reply)
Discussion started by: aish11
1 Replies

7. Shell Programming and Scripting

Help in file parsing with awk

Hi, I have a data set as shown below: 09e757fd,22727,2012-03-01,text1,text2,to 3fd0cae7,310,2012-03-01,text3,text4,to 3fd0cae7,310,2012-03-01,text3,text5,to 3fd0cae7,311,2012-03-01,text7,text10,cc 3fd0cae7,311,2012-03-01,text7,text11,to 3fd0cae7,312,2012-03-01,text8,text15,to... (3 Replies)
Discussion started by: shekhar2010us
3 Replies

8. Shell Programming and Scripting

awk parsing file

Looking to parse a file to remove the duplicates and get only few fields and uniq rows. input.tx Loc (TC) ID : ssfad_fs Serial : PIC002340098 ... (8 Replies)
Discussion started by: shunya
8 Replies

9. Shell Programming and Scripting

Parsing a file name with awk

I have a command to print out the top 5 most cpu intensive commands: ps aux --sort=-%cpu --no-headers I would like to make a printout containing only the parsed file name. So, I want to turn this: $ ps aux --sort=-%cpu --no-headers user 24883 4.3 1.7 2010436 131440 ? Sl ... (2 Replies)
Discussion started by: bedtime
2 Replies

10. UNIX for Beginners Questions & Answers

Create html <ui> <li> by parsing text file

Hi you all, this is my first post in this forum. I'm italian (please forgive me) :-) so my english will fail to be correct... Anyway, let's get straight to the point! I have a text file like this: ,,,, Disney: 00961-002,,,, ,Pippo: 00531-002,,, ,,Pluto: 00238-002,, ... (5 Replies)
Discussion started by: alcresio
5 Replies
DT2DV(1)						      General Commands Manual							  DT2DV(1)

NAME
dt2dv - convert a DTL text representation of a TeX DVI file to a binary DVI file SYNOPSIS
dt2dv [-debug] [-group] [-si] [-so] [input-DTL-file] [output-DVI-file] In the absence of the -si and -so options, both file arguments are required in the order input-DTL-file output-DVI-file . But also see the OPTIONS section below. No default file extensions are supplied. DESCRIPTION
dt2dv converts a text representation of a TeX DVI file, usually produced by the companion dv2dt(1) utility, back to a binary DVI file. DTL (DVI Text Language) files can be edited, with care, and then restored to DVI form for processing by any TeX DVI driver program. In DTL files, font directory names and font names are preceded by a length field, which must be updated if the names are modified. dvitype(1) can also display a textual representation of DVI files, but in some implementations at least, it cannot be used in batch mode, and its output is not well-suited for conversion back to a DVI file. The format of TeX DVI files is fully described in Donald E. Knuth, TeX: The Program, Addison-Wesley (1986), ISBN 0-201-13437-3, as well as in the dvitype(1) literate program source code. Brief descriptions of the DTL and DVI formats are given in dv2dt(1). OPTIONS
-debug Turn on detailed debugging output. -group Expect each DTL command to be in parentheses. -si Read all DTL commands from standard input. -so Write all DVI commands to standard output. SEE ALSO
dv2dt(1), dvitype(1), tex(1). FILES
*.dvi binary TeX DVI file. *.dtl text representation of a TeX DVI file in DVI Text Language format. AUTHOR
dt2dv and dv2dt(1) were written by Geoffrey Tobin Department of Electronic Engineering La Trobe University Bundoora, Victoria 3083 Australia Tel: +61 3 479 3736 FAX: +61 3 479 3025 Email: <G.Tobin@ee.latrobe.edu.au> These manual pages were written primarily by Nelson H. F. Beebe, Ph.D. Center for Scientific Computing Department of Mathematics University of Utah Salt Lake City, UT 84112 Tel: +1 801 581 5254 FAX: +1 801 581 4148 Email: <beebe@math.utah.edu> Version 0.6.0 08 March 1995 DT2DV(1)
All times are GMT -4. The time now is 01:21 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy