Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Changing different value to single value Post 302768979 by nsuresh316 on Monday 11th of February 2013 01:12:09 AM
Old 02-11-2013
Changing different value to single value

I have a input file like this
Code:
select column1,column2 from tablename where column3='1000000001';
select column1,column2 from tablename where column3='1000000002';
select column1,column2 from tablename where column3='1000000003';
select column1,column2 from tablename where column3='1000000004';
select column1,column2 from tablename where column3='1000000005';

I need like this
Code:
select column1,column2 from tablename where column3='1100000001';
select column1,column2 from tablename where column3='1100000001';
select column1,column2 from tablename where column3='1100000001';
select column1,column2 from tablename where column3='1100000001';
select column1,column2 from tablename where column3='1100000001';

Code:
My shell is csh

 

10 More Discussions You Might Find Interesting

1. HP-UX

Changing the machine name

I work on a UNIX HP 10.20 system that recently crashed. I am new with UNIX but I pick things up quick. The system I work on consists of two computers with the same basic hardware config. I have been having trouble loading the program software it uses, NOT the UNIX software, so I used the a... (1 Reply)
Discussion started by: gizmoking
1 Replies

2. Shell Programming and Scripting

Changing userID and Changing group and GID

Hello, I want to write a ksh script about changing UID and changing group with GID. There are multiple servers i want to perform that job. linux1 linux2 linux3 linux4 linux5 ...... . . . . . 1.) How can i enter "password" in script rather asking me? I was trying this... ssh... (2 Replies)
Discussion started by: deal732
2 Replies

3. Shell Programming and Scripting

Help with awk script, changing the FS for a single variable

Hi all, im new to awk and would apreciate if you could tell me how to do this, i have a file with several entries like this: 2008-09-09 21:57:45 44 403 CUSTOM_EVENT Upgrade - end1 2008-09-09 21:57:46 45 403 CUSTOM_EVENT Component Check - start... (3 Replies)
Discussion started by: sx3v1l_1n51de
3 Replies

4. Shell Programming and Scripting

unzip single file and untar single file

Dear friends, My requirement below- 1] I have a zip file on unix server - ETL_Extracts_20100218175009.zip which is composed of various entity extracts namely... ENTITY1.txt, ENTITY2.txt, ENTITY3.txt etc.... How do I unzip only a single file ..say ENTITY2.txt from this zip file. CAn you... (2 Replies)
Discussion started by: sureshg_sampat
2 Replies

5. UNIX for Dummies Questions & Answers

Changing / to - with vi

Hi just learning Unix in college now and this is my first post here, so I dunno if this goes here, or in the homework section technically. Anywho, trying to change all the / in a file into - using vi... i went into the command prompt, and put in :%s///-/g and it comes up with E488: Trailing... (2 Replies)
Discussion started by: SoVi3t
2 Replies

6. Shell Programming and Scripting

Replace single quote with two single quotes in perl

Hi I want to replace single quote with two single quotes in a perl string. If the string is <It's Simpson's book> It should become <It''s Simpson''s book> (3 Replies)
Discussion started by: DushyantG
3 Replies

7. Shell Programming and Scripting

Multiple lines in a single column to be merged as a single line for a record

Hi, I have a requirement with, No~Dt~Notes 1~2011/08/1~"aaa bbb ccc ddd eee fff ggg hhh" Single column alone got splitted into multiple lines. I require the output as No~Dt~Notes 1~2011/08/1~"aaa<>bbb<>ccc<>ddd<>eee<>fff<>ggg<>hhh" mean to say those new lines to be... (1 Reply)
Discussion started by: Bhuvaneswari
1 Replies

8. Homework & Coursework Questions

Changing a file

Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted! 1. The problem statement, all variables and given/known data: Make “hardlink” readable, writeable, executable by you, but not readable, writeable, executable by anyone else.... (4 Replies)
Discussion started by: lilbo4231
4 Replies

9. Shell Programming and Scripting

Paste 2 single column files to a single file

Hi, I have 2 csv/txt files with single columns. I am trying to merge them using paste, but its not working.. output3.csv: flowerbomb everlon-jewelry sofft steve-madden dolce-gabbana-watchoutput2.csv: http://www1.abc.com/cms/slp/2/Flowerbomb http://www1.abc.com/cms/slp/2/Everlon-Jewelry... (5 Replies)
Discussion started by: ajayakunuri
5 Replies

10. UNIX for Advanced & Expert Users

Changing single path NIC to a teamed connection in same subnet

Dear all, I have a remote CentOS7 server that has two network cards. Each card has four ports and port one of card one was defined with the IP address assigned to the server. So far, so good and it's been working for over a year. We have now got cables sorted out so there are four paths... (4 Replies)
Discussion started by: rbatte1
4 Replies
nismatch(1)							   User Commands						       nismatch(1)

NAME
nismatch, nisgrep - utilities for searching NIS+ tables SYNOPSIS
nismatch [-AchMoPv] [-s sep] key tablename nismatch [-AchMoPv] [-s sep] colname = key... tablename nismatch [-AchMoPv] [-s sep] indexedname nisgrep [-AchiMov] [-s sep] keypat tablename nisgrep [-AchiMov] [-s sep] colname = keypat... tablename DESCRIPTION
The utilities nismatch and nisgrep can be used to search NIS+ tables. The command nisgrep differs from the nismatch command in its ability to accept regular expressions keypat for the search criteria rather than simple text matches. Because nisgrep uses a callback function, it is not constrained to searching only those columns that are specifically made searchable at the time of table creation. This makes it more flexible, but slower, than nismatch. In nismatch, the server does the searching, whereas in nisgrep the server returns all the readable entries and then the client does the pattern-matching. In both commands, the parameter tablename is the NIS+ name of the table to be searched. If only one key or key pattern is specified with- out the column name, then it is applied searching the first column. Specific named columns can be searched by using the colname=key syntax. When multiple columns are searched, only entries that match in all columns are returned. This is the equivalent of a logical join opera- tion. nismatch accepts an additional form of search criteria, indexedname, which is a NIS+ indexed name of the form: [ colname=value, ... ],tablename OPTIONS
The following options are supported: -A All data. Return the data within the table and all of the data in tables in the initial table's concatenation path. -c Print only a count of the number of entries that matched the search criteria. -h Display a header line before the matching entries that contains the names of the table's columns -i Ignore upper/lower case distinction during comparisons. -M Master server only. Send the lookup to the master server of the named data. This guarantees that the most up to date information is seen at the possible expense that the master server may be busy. -o Display the internal representation of the matching NIS+ object(s). -P Follow concatenation path. Specify that the lookup should follow the concatenation path of a table if the initial search is unsuccessful. -s sep This option specifies the character to use to separate the table columns. If no character is specified, the default separator for the table is used. -v Verbose. Do not suppress the output of binary data when displaying matching entries. Without this option binary data is displayed as the string *BINARY*. EXAMPLES
Example 1 Searching a table for a username This example searches a table named passwd in the org_dir subdirectory of the zotz.com. domain. It returns the entry that has the user- name of skippy. In this example, all the work is done on the server: example% nismatch name=skippy passwd.org_dir.zotz.com. Example 2 Finding users using specific shells This example is similar to the one above, except that it uses nisgrep to find all users in the table named passwd that are using either ksh(1) or csh(1): example% nisgrep 'shell=[ck]sh' passwd.org_dir.zotz.com. ENVIRONMENT VARIABLES
NIS_PATH If this variable is set, and the NIS+ table name is not fully qualified, each directory specified will be searched until the table is found (see nisdefaults(1)). EXIT STATUS
The following exit values are returned: 0 Successfully matches some entries. 1 Successfully searches the table and no matches are found. 2 An error condition occurs. An error message is also printed. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWnisu | +-----------------------------+-----------------------------+ SEE ALSO
niscat(1), nisdefaults(1), nisls(1), nistbladm(1), nis_objects(3NSL), attributes(5) DIAGNOSTICS
No memory An attempt to allocate some memory for the search failed. tablename is not a table The object with the name tablename was not a table object. Can't compile regular expression The regular expression in keypat was malformed. column not found: colname The column named colname does not exist in the table named tablename. NOTES
NIS+ might not be supported in future releases of the Solaris operating system. Tools to aid the migration from NIS+ to LDAP are available in the current Solaris release. For more information, visit http://www.sun.com/directory/nisplus/transition.html. SunOS 5.11 2 Dec 2005 nismatch(1)
All times are GMT -4. The time now is 06:48 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy