06-15-2012
Selective case conversion of a file
Hi all,
I have a requirement to convert a file from one format to another.
Parent file:
to
Quote:
Sample: abcdefgh
domain: when you think abcd
domain: abcdefgh
Goods for purchase:234
domain: efgh
Sample: pqrst
Sample: nmjkl
Sample: 123jjkl mer.
Goods for purchase: No ChaNGE
i.e.,
1.) all the lines which begin with "Sample:", should be converted in such a way that entire text after ":" gets converted into all-lower case.
2.) all the lines which begin with "domain:" get stripped off the text mentioned after "@" sign.
Please guide.
Thanks in advance
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
How can convert a Lower case variable value to an upper case in the kron shell script. (3 Replies)
Discussion started by: dchalavadi
3 Replies
2. UNIX for Dummies Questions & Answers
Hello,
I have been trying all sorts of combinations and been royally screwing up my filesystem in the process :rolleyes: I have a bunch of .wav files in a hierarchical album/artist etc folder structure and each has a duplicate .w4a file next to it.
All I want to do is move all the .w4a... (7 Replies)
Discussion started by: dinalt
7 Replies
3. UNIX for Dummies Questions & Answers
Hello,
I am using dircmp -d <folde1> <Folder2> to compare the files from two different foldes, but this command compares for all the files. Is there any option to select only some files for comparision. For example in
Folder1:
file1.txt
file2.txt
file3.txt
Folder2
file1.txt
file2.txt... (0 Replies)
Discussion started by: gmahesh2k
0 Replies
4. Shell Programming and Scripting
Hi,
There's an xml file produced from a front-end tool as shown below:
<INPUT DATABASE ="ORACLE" DBNAME ="UNIX" NAME ="FACT_TABLE" OWNERNAME ="DIPS">
<INPUTFIELD DATATYPE ="double" DEFAULTVALUE ="" DESCRIPTION ="" NAME ="STORE_KEY" PICTURETEXT ="" PORTTYPE ="INPUT" PRECISION ="15" SCALE... (6 Replies)
Discussion started by: dips_ag
6 Replies
5. Shell Programming and Scripting
Hello,
I have a text file which I need to check for presence of certain tags, and then copy a subsequent portion of text into another file. The tag matching canbe done with Grep but I do not know how to copy selective lines from one file to another. Is it possible do that?
I checked up some... (8 Replies)
Discussion started by: ajayram
8 Replies
6. Shell Programming and Scripting
Hello Unix Gurus :
It would be really appreciative if can find a solution for this .
I have records in a file .
I need to Capitalize the records based on condition .
For Example i tried the following Command
COMMAND -->
fgrep "2000YUYU" /export/home/oracle/TST/data.dat | tr '' ''... (12 Replies)
Discussion started by: tsbiju
12 Replies
7. Shell Programming and Scripting
Hi,
This is a vcd file.A vcd file may have 'n' modules.
1) I need to capture the data in bold,i.e. the module names (shown in bold)
2) Also i need to capture the data inside each individual module,say for tst_bench_top ,i need to capture data from line 4 to line 20 ...
I just want one... (2 Replies)
Discussion started by: veerabahu
2 Replies
8. Shell Programming and Scripting
I have the following file which at times can be quite large so can be difficult to read, I need a script that just extracts particular delimited data and outputs to alternate file
$cat fix1.log
FIX4.4|0=12|55=LIT.L|48=123456|32=5|52=20111107-10:52:22.128|38=100|10=200|
... (6 Replies)
Discussion started by: Buddyluv
6 Replies
9. Shell Programming and Scripting
Hi All,
I need the variable to be set in both uppercase and lowercase in a single command
DATABASE=ORCL
something like the below which is absolutly wrong
find /ora/admin/11.1.0/diag/rdbms/{print tolower($0)}${DATABASE}/{print toupper($0)}${DATABASE}
The o/p should be as below:... (4 Replies)
Discussion started by: jjoy
4 Replies
10. Shell Programming and Scripting
i am looking for a backup script to be run in ssh which can move all *.php files only to a archive
Eg. a folder has 5 sub folders with different file types, which can be mix of PDF, jpeg, gif etc etc.
but the archive generated should only include the *.php files without breaking the directory... (3 Replies)
Discussion started by: netatma
3 Replies
LEARN ABOUT MOJAVE
userselector
UserSelector(7) BSD Miscellaneous Information Manual UserSelector(7)
NAME
UserSelector -- overview and documentation
DESCRIPTION
UserSelector is invoked only internally by the CryptoTokenKit framework. It is not intended to be used directly by an end user or an adminis-
trator. Unless the string property UserSelectorPath is set with full executable path value in the configuration file (
/etc/SmartcardLogin.plist ), the system UserSelector is used.
How CryptoTokenKit framework invokes UserSelector:
UserSelector -o operation -u username -i pubkeyhash1[,pubkeyhash2,...]
Path and format
UserSelector runs in a sandbox which limits its path and file format. A custom UserSelector must be stored in the /Library/CryptoTokenKit
directory. The file format of the UserSelector must be binary. Shell scripts are not supported.
Supported Operations
Map Operation
This operation returns a list of users bound with pubkeyhashes from the SmartCard certificates. The username parameter is optional. If set,
bindings are returned only for the specified user. The list of one or more comma separated pubkeyhashes is mandatory.
Result format:
Recognized bindings are returned through stdout. Each binding is placed on a separate line. Each line begins with the pubkeyhash string, fol-
lowed by the TAB character ( ) and by the username.
Sample:
$ UserSelector -o map -i 01234567890123456789,ABCDEF01230123456789,98765432109876543210
ABCDEF01230123456789 user1
98765432109876543210 user2
Bind Operation
This operation creates binding between the provided pubkeyhash and username .
Result format:
Exit code is set to 0 when succeeded, error code otherwise
Sample:
$ UserSelector -o bind -i ABCDEF01230123456789 -u username1
Unbind Operation
This operation removes SmartCard bindings for the provided username If no pubkeyhash is provided, all bindings for that user are removed. If
one or more pubkeyhashes are provided, only bindings for these are removed.
Result format:
Exit code is set to 0 when succeeded, error code otherwise
Sample:
$ UserSelector -o unbind -u username1 -i ABCDEF01230123456789
Check Operation
This operation checks SmartCard bindings for a specific user. It returns 0 on stdout when the user has no SmartCard bindings, or 1 when
already does. The username parameter is mandatory.
Sample:
$ UserSelector -o check -u username1
1
SEE ALSO
SmartCardServices(7), sc_auth(8)
macOS Oct 12, 2017 macOS