Sponsored Content
Full Discussion: Text Translation
Special Forums UNIX Desktop Questions & Answers Text Translation Post 302500765 by Corona688 on Tuesday 1st of March 2011 12:38:10 PM
Old 03-01-2011
That is a useless use of cat. Whenever you do cat foo | program you can also do program < foo to save your program a lot of wasted CPU time.

For programs that take filenames, like awk does, you can even do
program foo


Code:
$ awk '{
         if($0 ~/original/ )
                 print "TEXT1"
         else if($0 ~/dollars/)
                 print "TEXT2"
         else
                 print $0
 }
 ' datafile
20110228 Mike Original apartment costed almost 23277AA
TEXT2
20110219 BUT THAT WAs magical and everyone was so elated to see 93884
20110222 so would you want to join us 38488

Note that original and Original are not the same.
These 2 Users Gave Thanks to Corona688 For This Post:
 

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
XmTextReplaceWcs(3X)													      XmTextReplaceWcs(3X)

NAME
XmTextReplaceWcs - A Text function that replaces part of a wide character string in a Text widget SYNOPSIS
#include <Xm/Text.h> void XmTextReplaceWcs (widget, from_pos, to_pos, wcstring) Widget widget; XmTextPosition from_pos; XmTextPosition to_pos; wchar_t *wcstring; DESCRIPTION
XmTextReplaceWcs replaces part of the wide character string in the Text widget. The character positions begin at zero and are numbered sequentially from the beginning of the text. An example text replacement would be to replace the second and third characters in the text string. To accomplish this, the from_pos parameter must be 1 and the to_pos parameter must be 3. To insert a string after the fourth character, both the from_pos and to_pos param- eters must be 4. This routine calls the widget's XmNvalueChangedCallback and verification callbacks, either XmNmodifyVerifyCallback or XmNmodifyVerifyCall- backWcs, or both. If both verification callback lists are registered, the procedures of the XmNmodifyVerifyCallback list are executed first and the resulting data is passed to the XmNmodifyVerifyCallbackWcs callbacks. Specifies the Text widget ID Specifies the start posi- tion of the text to be replaced Specifies the end position of the text to be replaced Specifies the wide character string value to be added to the Text widget For a complete definition of Text and its associated resources, see XmText(3X). SEE ALSO
XmText(3X), XmTextReplace(3X) XmTextReplaceWcs(3X)
All times are GMT -4. The time now is 01:41 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy