Sponsored Content
Full Discussion: Text Translation
Special Forums UNIX Desktop Questions & Answers Text Translation Post 302500764 by ctsgnb on Tuesday 1st of March 2011 12:38:04 PM
Old 03-01-2011
Note that lines conaining none of the given pattern will not be displayed :

Code:
nawk '/Original/{y="TEXT1"}/dollars/{y="TEXT2"}/magical/{y="TEXT3"}/join/{y="TEXT4"}y{x=$NF;print $1,y,x;y=t}' infile

If you want them be displayed :

Code:
nawk '/Original/{y="TEXT1"}/dollars/{y="TEXT2"}/magical/{y="TEXT3"}/join/{y="TEXT4"}{x=$NF;print (y)?$1 FS y FS x:$0;y=t}' infile

You could also replace
Code:
/Original/{y="TEXT1"}

with
Code:
(tolower($0))~/original/{y="TEXT1"}

for a case non-sensitive comparison

Last edited by ctsgnb; 03-01-2011 at 02:01 PM..
 

7 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

need translation?

Can someone tell me exactly what this code is doing? # # gnutest # # Test launch of ghostscript (gs) from a script # rm gnutest.ps # # ------- calculation that would generate file(s) to # be plotted with gnuplot would be placed here ----------- # gnuplot << \E-o-f2 set... (1 Reply)
Discussion started by: wmosley2
1 Replies

2. Programming

Swedish Character translation

Sorry if this been posted before. At the moment I'm having problem with the iscntrl() function. I need it to run a check on code entered into a Text Box, however I also need to allow the "Ö, ö" Swedish characters. The iscntrl() function seems to pick up the characters above as part of the... (0 Replies)
Discussion started by: rebelwassie
0 Replies

3. Shell Programming and Scripting

I need translation!

Someone give me info on this script. I put all the parts I do not understand in BOLD. Please someone explain what the parts in BOLD does/mean. Thanks! #!/bin/bash #Usage: cmdArgs.sh arg1 arg2 arg3 printf "The number of command line args is: $#\n" declare -i counter #Not strictly... (7 Replies)
Discussion started by: 801238429
7 Replies

4. UNIX for Dummies Questions & Answers

help --translation

I am reading the SANS security policy--.I want to translate the to Chinese.But I don`t understand a paragraph of the. It is :"Where SNMP is used, the community strings must be defined as something other than the standard defaults of "public," "private" and "system" and must be different from... (1 Reply)
Discussion started by: beijingzhzj
1 Replies

5. UNIX for Dummies Questions & Answers

AIX to HP-UX translation please

I have been looking up the allocated space, free space and the contents (raw, jfs, paging) of the logical volumes in AIX servers. I have been using lsvg and lsvg -l (server name). What is the HP-UX equivalent to that? I was given this command also so I would not have to type in each volume group... (2 Replies)
Discussion started by: compan023
2 Replies

6. AIX

Can't ping - IP translation issue?

Hello, Any help or advice on this would be greatly appreciated. I have a site-to-site VPN, across which data is synced between two CRM systems. The opposing side of this tunnel is a flat network (lets call it 201.200.156.xx/24) My internal network is a 192.168.0.xx/24 network, however before... (2 Replies)
Discussion started by: thruster9
2 Replies

7. IP Networking

Network address translation

How would one approach the problem of determining the NAT tables of a router without knowing the userid and password. The only password holder died. I know the internal ip address of the router is 192.168.2.1, and also ports 80 or 8080 and 3389 are open. (5 Replies)
Discussion started by: jgt
5 Replies
UPDATE-DESKTOP-DATABASE(1)				      General Commands Manual					UPDATE-DESKTOP-DATABASE(1)

NAME
update-desktop-database - Build cache database of MIME types handled by desktop files SYNOPSIS
update-desktop-database [-q|--quiet] [-v|--verbose] [DIRECTORY...] DESCRIPTION
The update-desktop-database program is a tool to build a cache database of the MIME types handled by desktop files. The cache database contains the list of MIME types that can be handled by desktop files, as well as, for each MIME type, a list of desktop files that can handle this MIME type. This cache database ease the work of applications that need to find an application that can open a document of a specific MIME type: those applications will not have to parse all the desktop files existing on the system, and can instead parse this cache database. If no DIRECTORY is specified as argument, the desktop files that will be processed are the ones installed in $XDG_DATA_DIRS/applications. If both the --quiet and --verbose options are used, then --verbose will be ignored. OPTIONS
The following options are supported: -q, --quiet Do not display any information about processing and updating progress. -v, --verbose Display more information about processing and updating progress. NOTES
If an invalid MIME type is met, it will be ignored and the creation of the cache database will continue. The format of the cache database is a simple desktop entry format, with a MIME Cache group, containing one key per MIME type. The key name is the MIME type, and the key value is the list of desktop file that can handle this MIME type. The order of the desktop files found for a MIME type is not significant. Therefore, an external mechanism must be used to determine what is the preferred desktop file for a MIME type. EXAMPLE
Here is a simple example of a cache database: [MIME Cache] application/x-shellscript=gedit.desktop; text/plain=gedit.desktop;gvim.desktop; video/webm=totem.desktop; This cache database is created with three desktop files, each containing a MimeType key: gedit.desktop: MimeType=text/plain;application/x-shellscript; gvim.desktop: MimeType=text/plain; totem.desktop: MimeType=video/webm; FILES
$XDG_DATA_DIRS/applications/mimeinfo.cache This file is the cache database created by update-desktop-database. BUGS
If you find bugs in the update-desktop-database program, please report these on https://bugs.freedesktop.org. FREEDESKTOP.ORG UPDATE-DESKTOP-DATABASE(1)
All times are GMT -4. The time now is 04:39 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy