The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
awk and file parsing devtakh Shell Programming and Scripting 4 05-06-2008 11:13 AM
Parsing xml file using Sed kapilkinha UNIX for Advanced & Expert Users 3 04-08-2008 09:43 AM
Parsing a csv file chiru_h Shell Programming and Scripting 6 02-12-2008 09:33 AM
File Parsing jsusheel Shell Programming and Scripting 5 09-25-2007 10:25 AM
parsing file through awk bbeugie Shell Programming and Scripting 13 08-22-2006 01:21 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 05-16-2008
eamani_sun eamani_sun is offline
Registered User
  
 

Join Date: May 2008
Posts: 40
Help me with parsing this file

Hi,

I need a shell script that would parse this file

/usr/share/i18n/locales/aa_DJ:title "Afar language locale for Djibouti (Cadu/Laaqo Dialects)."
/usr/share/i18n/locales/aa_ER:title "Afar language locale for Eritrea (Cadu/Laaqo Dialects)."
/usr/share/i18n/locales/aa_ER@saaho:title "Afar language locale for Eritrea (Saaho Dialect)."
/usr/share/i18n/locales/aa_ET:title "Afar language locale for Ethiopia (Cadu/Carra Dialects)."


I want output as this

Afar language locale for Djibouti (Cadu/Laaqo Dialects)
Afar language locale for Eritrea (Cadu/Laaqo Dialects)
Afar language locale for Eritrea (Saaho Dialect)
Afar language locale for Ethiopia (Cadu/Carra Dialects).

I'll greatly appreciate any help.


Thanks,
Sundeep
  #2 (permalink)  
Old 05-16-2008
era era is offline Forum Advisor  
Herder of Useless Cats (On Sabbatical)
  
 

Join Date: Mar 2008
Location: /there/is/only/bin/sh
Posts: 3,652
Code:
sed -e 's/.*"//;s/\."$//' file
That's not parsing, though, it's just throwing away the parts you don't want.
  #3 (permalink)  
Old 05-16-2008
Franklin52 Franklin52 is offline Forum Staff  
Moderator
  
 

Join Date: Feb 2007
Posts: 4,300
Or:

Code:
awk -F"\"" '{print $2}' file
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 03:43 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0