Sponsored Content
Top Forums Shell Programming and Scripting How to make delimited record ???? Post 302594319 by ns64110 on Tuesday 31st of January 2012 04:14:01 AM
Old 01-31-2012
actually i am getting this file from third party and i need to process it

is it possible if we can count number of character between each column suppose

so that we can get length of each column and retrivee data on length basis


---------- Post updated at 04:14 AM ---------- Previous update was at 04:06 AM ----------

One more question can we retrieve last three column

I/P:

1999999488~TESTING/D~12042009~12042009~0904060004~2500~ACCEPTED~
1999999497~TESTING/E~12042009~12042009~0904060006~1000~ACCEPTED~P
1999999513~PBBBBBBB~SNAME/P~12042009~12042009~0904080001~5000~ACCEPTED~

i want to fetch last 4 column

o/p:

0904060004~2500~ACCEPTED~
0904060006~1000~ACCEPTED~P
0904080001~5000~ACCEPTED~
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

help with awk delimited by |~| in a record

I have a file which contains 1 million records of the following format. Each field is delimited by a pipe tilda pipe "|~|" show below. I would like to print only one column ie the CARDDESC value. for example here it says CARDDESC=A8T1. so anything after CARDDESC= and before |~|CARDTYPE is what... (11 Replies)
Discussion started by: knijjar
11 Replies

2. Shell Programming and Scripting

Split a record ( in a row) and make it as new row

Hi All, The following is the scenario id name -------------- 1 William;Johnson 2 Azim;Abdul 3 Grasim . . etc.... I need the following output id name -------------- 1 William 1 Johnson 2 Azim (2 Replies)
Discussion started by: kottursamy
2 Replies

3. Red Hat

Counting columns in a delimited record with NULLs

I am trying to count the number of columns in a delimited flat file. The record is tab delimited. When I use the command wc -w, I am getting unexpected results when the record contains a NULL value. I believe it is because there is a "word" missing. The below example will return 4 words... (2 Replies)
Discussion started by: nmalencia
2 Replies

4. Shell Programming and Scripting

Make variable length record a fixed length

Very, very new to unix scripting and have a unique situation. I have a file of records that contain 3 records types: (H)eader Records (D)etail Records (T)railer Records The Detail records are 82 bytes in length which is perfect. The Header and Trailer records sometimes are 82 bytes in... (3 Replies)
Discussion started by: jclanc8
3 Replies

5. Shell Programming and Scripting

Managing sequence to make unique record

Hi Everyone, Using shell script i am getting final file as attached below. In this 4th column value should be unique using any sequence. for instance I've 1_13020_SSGM which is appearing 6 times in file and i should change it like 1_13020_SSGM_1,1_13020_SSGM_2,....1_13020_SSGM_6. Can someone... (4 Replies)
Discussion started by: gehlnar
4 Replies

6. Shell Programming and Scripting

Need a script to convert comma delimited files to semi colon delimited

Hi All, I need a unix script to convert .csv files to .skv files (changing a comma delimited file to a semi colon delimited file). I am a unix newbie and so don't know where to start. The script will be scheduled using cron and needs to convert each .csv file in a particular folder to a .skv... (4 Replies)
Discussion started by: CarpKing
4 Replies

7. Shell Programming and Scripting

How to make tab delimited file to space delimited?

Hi How to make tab delimited file to space delimited? in put file: ABC kgy jkh ghj ash kjl o/p file: ABC kgy jkh ghj ash kjl Use code tags, thanks. (1 Reply)
Discussion started by: jagdishrout
1 Replies

8. Shell Programming and Scripting

Insert a header record (tab delimited) in multiple files

Hi Forum. I'm struggling to find a solution for the following issue. I have multiple files a1.txt, a2.txt, a3.txt, etc. and I would like to insert a tab-delimited header record at the beginning of each of the files. This is my code so far but it's not working as expected. for i in... (2 Replies)
Discussion started by: pchang
2 Replies

9. Shell Programming and Scripting

How to delete 'duplicated' column values and make a delimited file too?

Hi, I have the following output from an Oracle SQL statement and I want to remove duplicated column values. I know it is possible using Oracle analytical/statistical functions but unfortunately I don't know how to use any of those. So now, I've gone to PLAN B using awk/sed maybe or any... (5 Replies)
Discussion started by: newbie_01
5 Replies

10. Shell Programming and Scripting

Help/Advise please for converting space delimited string variable to comma delimited with quote

Hi, I am wanting to create a script that will construct a SQL statement based on a a space delimited string that it read from a config file. Example of the SQL will be For example, it will read a string like "AAA BBB CCC" and assign to a variable named IN_STRING. I then concatenate... (2 Replies)
Discussion started by: newbie_01
2 Replies
clu_get_info(8) 					      System Manager's Manual						   clu_get_info(8)

NAME
clu_get_info - Gets information about a cluster and its members SYNOPSIS
/usr/sbin/clu_get_info [-full] [-q] [-m memberid] [-raw] [-state] OPTIONS
The -full option returns detailed information about all members in the cluster, or about one member if the -m memberid option is specified. Suppresses output. Use this option when only the return value is of interest; for example, to determine whether the system is running as a cluster member. When specified in combination with the -m option, the -q option can be used to determine whether a particular member of a cluster is up or down. For example: # clu_get_info -q -m 2 && echo "Member 2 is a member of the cluster" Member 2 is a member of the clus- ter The -m option returns information about the member specified by memberid. The -raw option returns detailed information about the clus- ter and all members in the cluster in raw output, which is intended to be used as input to scripts. The -state option returns the state of all members in the cluster in raw output. The states returned are: UP, DOWN, or NOT_CONF (not configured). DESCRIPTION
When invoked on a member of a cluster, the clu_get_info command displays general information about the cluster and its members. The infor- mation includes: The name of the cluster and the number of members configured in the cluster. The member ID of the member issuing the com- mand. The device name and number of votes of the quorum disk, if configured. For each member, its member ID, host name, cluster intercon- nect IP name, and current state (UP or DOWN). When invoked on a system that is not a cluster member, the clu_get_info command prints an error message and exits. The clu_get_info -full option displays additional information about the cluster. The information includes: Cluster incarnation -- A hexa- decimal number used to uniquely identify the cluster. Cluster expected votes -- Number of votes expected when all configured cluster mem- bers are up and any configured quorum disk is present. Current votes -- The number of votes contributed by current cluster members and the quorum disk as seen by this member. Quorum votes -- The number of votes required for the cluster to be up and running. The clu_get_info -full command also displays the following information for each member: Cluster interconnect IP address -- The IP address of the cluster interconnect. Member base O/S version -- The version of the base operating system. Member cluster version -- The version of the TruCluster Server software. Member running version -- The current running version of the TruCluster software, which returns one of the following: INSTALLED -- the current running version; same as the member cluster version returned. BELOW INSTALLED -- one version below the current running version returned in member cluster version; useful when performing a rolling upgrade. UNKNOWN -- the running version is unknown. Member name -- The member name used by the connection manager (CNX) as a member identifier. Node votes -- The votes assigned to this member (as set in the cluster_node_votes kernel attribute for the clubase subsystem). csid -- The cluster system identifier, which is a unique hexadecimal number that identifies each member in a cluster. The clu_get_info -raw option displays detailed information, in raw output, about all members in the cluster. This output is intended to be used as input to scripts. Data is unlabeled, and data fields are separated by colons. The fields returned are the same as if specifying the -full option only data is in raw format. The clu_get_info -raw option returns a clusterwide information record and member-specific information records. A clusterwide information record begins with the initiator C and returns data in the following order: Cluster name Number of members configured in this cluster Mem- ber ID for this member Cluster incarnation Cluster expected votes Current votes Votes required for quorum Quorum disk Quorum disk votes A member-specific information record begins with the initiator M and returns data in the following order: Member ID Host name Cluster interconnect IP name Cluster interconnect IP address Member state Member base O/S version Member cluster version Member running version Member name Member votes Csid The clu_get_info -state option displays the state of all members in the cluster. Output is intended to be used by a script to determine which cluster members are up, down, or not configured. Data is unlabeled, and data fields are separated by colons. A state information record begins with the initiator S and returns the following output based on the configuration state of all members in the cluster: UP -- The member ID is configured and up. DOWN -- The member ID is configured and down. NOT_CONF -- The member ID is not configured in the cluster. If a member of the cluster is down, clu_get_info displays UNKNOWN in various member fields. If the member is down and its /etc/rc.config file contains illegal values, clu_get_info displays CONFIGURATION_ERROR in the related fields. An example is provided in the EXAMPLES sec- tion. EXIT STATUS
Success. The system is not a cluster member or an error has occurred. EXAMPLES
The following command displays general information about the cluster and its members: # clu_get_info Cluster information for cluster deli Number of members configured in this cluster = 3 Memberid for this member = 1 Quorum disk = dsk4h Quorum disk votes = 1 Information on each cluster member Cluster memberid = 1 Hostname = polishham.zk4.com Cluster interconnect IP name = polishham-mc0 Member state = UP Cluster memberid = 2 Hostname = provolone.zk4.com Cluster interconnect IP name = provolone-mc0 Member state = UP Cluster memberid = 3 Hostname = pepicelli.zk4.com Cluster interconnect IP name = pepicelli-mc0 Member state = UP If one member of the cluster is down and its rc.config file contains illegal values, the following is displayed: Cluster memberid = 2 Hostname = CONFIGURATION_ERROR Cluster interconnect IP name = CONFIGURATION_ERROR Member state = DOWN The following command displays general information about one member: # clu_get_info -m 1 Cluster memberid = 1 Hostname = polishham.zk4.com Cluster interconnect IP name = polishham-mc0 Member state = UP The following command displays more information about all members in the cluster: # clu_get_info -full Cluster information for cluster deli Number of members configured in this cluster = 3 Memberid for this member = 1 Cluster incarnation = 0x7b5c2 Cluster expected votes = 3 Current votes = 3 Votes required for quorum = 2 Quorum disk = dsk4h Quorum disk votes = 1 Information on each cluster member Cluster memberid = 1 Hostname = polishham.zk4.com Cluster interconnect IP name = polishham-mc0 Cluster interconnect IP address = 10.0.0.1 Member state = UP Member base O/S version = Compaq Tru64 UNIX V5.0A Member cluster version = TruCluster Server V5.0A Member running version = INSTALLED Member name: polishham Member votes = 1 csid = 0x10001 Cluster memberid = 2 Hostname = provolone.zk4.com Cluster interconnect IP name = provolone-mc0 Cluster interconnect IP address = 10.0.0.2 Member state = UP Member base O/S version = Compaq Tru64 UNIX V5.0A Member cluster version = TruCluster Server V5.0A Member running version = INSTALLED Member name: provolone Member votes: 1 csid = 0x10002 Cluster memberid = 3 Hostname = pepicelli.zk4.com Cluster interconnect IP name = pepicelli-mc0 Cluster interconnect IP address = 10.0.0.3 Member state = UP Member base O/S version = Compaq Tru64 UNIX V5.0A Member cluster version = TruCluster Server V5.0A Member running version = INSTALLED Member name: pepicelli Member votes: 1 csid = 0x10003 If one member of the cluster is down and its rc.config file contains illegal values, the following is displayed: Cluster memberid = 2 Hostname = CONFIGURATION_ERROR Cluster interconnect IP name = CONFIGURATION_ERROR Cluster interconnect IP address = CONFIGURATION_ERROR Member state = DOWN Member base O/S version = CONFIGURATION_ERROR Member cluster version = CONFIGURATION_ERROR Member running version = UNKNOWN Member name = UNKNOWN Member votes = UNKNOWN csid = UNKNOWN The following command displays more information about a particular member of the cluster: # clu_get_info -full -m 1 Cluster memberid = 1 Hostname = polishham.zk4.com Cluster interconnect IP name = polishham-mc0 Cluster interconnect IP address = 10.0.0.1 Member state = UP Member base O/S version = Compaq Tru64 UNIX V5.0A Member cluster version = TruCluster Server V5.0A Member running version = INSTALLED Member name: polishham Member votes: 1 csid = 0x10001 The following command displays detailed information about all members in the cluster in raw output: # clu_get_info -raw C:deli:3:2:0x7b5c2:3:3:2:(null):0 M:1:polishham.zk4.com:polishham-mc0:10.0.0.1:UP:Compaq Tru64 UNIX V5.0A: TruCluster Server V5.0A:INSTALLED:polishham:1:0x10001 M:2:provolone.zk4.com:provolone-mc0:10.0.0.2:UP:Compaq Tru64 UNIX V5.0A: TruCluster Server V5.0A:INSTALLED:provolone:1:0x10002 M:3:pepicelli.zk4.com:pepicelli-mc0:10.0.0.3:UP:Compaq Tru64 UNIX V5.0A: TruCluster Server V5.0A:INSTALLED:pepicelli:1:0x10003 The following command displays the state of all members in the cluster: # clu_get_info -state S:NOT_CONF:UP:UP:UP:NOT_CONF:NOT_CONF:NOT_CONF:NOT_CONF FILES
Run-time configuration file for each cluster member. SEE ALSO
Functions: clu_get_info(3) Files: rc.config(8) TruCluster Server Administration Guide clu_get_info(8)
All times are GMT -4. The time now is 11:01 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy