Sponsored Content
Top Forums Shell Programming and Scripting separating comma delimited words Post 302349119 by summer_cherry on Monday 31st of August 2009 06:51:26 AM
Old 08-31-2009
perl:
Code:
my @arr;
open FH,"<a.txt";
while(<FH>){
  chomp;
  my @tmp=split("[:,]",$_);
  @arr=(@arr,@tmp[1..$#tmp]);
}
print join "\n", @arr;

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Converting Tab delimited file to Comma delimited file in Unix

Hi, Can anyone let me know on how to convert a Tab delimited file to Comma delimited file in Unix Thanks!! (22 Replies)
Discussion started by: charan81
22 Replies

2. Shell Programming and Scripting

Merging files into a single tab delimited file with a space separating

I have a folder that contains say 50 files in a sequential order: cdf_1.txt cdf_2.txt cdf_3.txt cdf_3.txt . . . cdf_50.txt. I need to merge these files in the same order into a single tab delimited file. I used the following shell script: for x in {1..50}; do cat cdf_${x}.txt >>... (3 Replies)
Discussion started by: Lucky Ali
3 Replies

3. Shell Programming and Scripting

Separating delimited file by pattern with exclusion list

I have a file with the contents below jan_t=jan;feb_t=feb;mar_t=mar;year=2010 jan_t=null;feb_t=feb;mar_t=mar;year=2010 jan_t=jan;feb_t=feb;mar_t=mar;year=2010 I want to extract out all the fields values ending with "_t" , however, i want to exclude feb_t and mar_t from the results In... (6 Replies)
Discussion started by: alienated
6 Replies

4. Shell Programming and Scripting

Keeping Null's as it is and separating them by Comma

Hi, I am having source (Oracle) as given below. SourceOBJECT_NAMESUBOBJECT_NAMEOBJECT_IDDATA_OBJECT_IDOBJECT_TYPECREATEDLAST_DDL_TIMESTAMPSTATUSTGSTEST 336559336559TABLE4/15/2009 10:374/15/2009 10:372009-04-15:10:37:57VALIDNNNUNIX 336559336559TABLE4/15/2009 10:374/15/2009... (3 Replies)
Discussion started by: arunvasu2
3 Replies

5. Shell Programming and Scripting

Separating list of input files (*.file) with a comma in bash script

Hi all, I'm trying to get a bash script working for a program (bowtie) which takes a list of input files (*.fastq) and assembles them to an output file (outfile.sam). All the .fastq files are in one folder in my home directory (~/infiles). The problem is that the 'bowtie' requires that... (7 Replies)
Discussion started by: TuAd
7 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. Homework & Coursework Questions

ASCII comma-delimited

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: Hi Guys, I am new on the scripting world and would like ask for help if you can. Here are my questions... (1 Reply)
Discussion started by: mahiwaga
1 Replies

8. Shell Programming and Scripting

Separating words in a line

Hi I have the following file # cat red it.d-state = 50988 41498 45 0 0 0 it.age_buffer= 1500 it.dir = 1 I need to grep lines that are present after "=" But when I do so, few lines has more than one value and some has one How to parse the line I have used the follwing... (6 Replies)
Discussion started by: Priya Amaresh
6 Replies

9. 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

10. Shell Programming and Scripting

Awkscript to reduce words delimited with comma on right hand to columns

I have a large database with the following structure: Indicword,Indicword,Indicword=English on a line. Not all lines will have this structure. Some might have a single word mapping to a single word in Indic. An example will make this clear ... (4 Replies)
Discussion started by: gimley
4 Replies
elmalias(1)						      General Commands Manual						       elmalias(1)

NAME
elmalias - display and verify elm user and system aliases SYNOPSIS
format[alias-name-list] Remarks The former functionality of the command has been taken over by the command (see newalias(1)). DESCRIPTION
The command displays and verifies user and system aliases. The system database must have been created by the command (see newalias(1)). The user database must have been created by either the com- mand or the mail system (see elm(1)). If the same alias is in both databases, the user version is used. Missing database files are silently ignored. Each database entry can have the following fields, which are described in detail in newalias(1): alias-list A list of one or more aliases for the entry. address-list A list of one or more addresses for the entry. An address can be an alias from another entry's alias-list. comment An optional field containing information about the entry. This field is not included in outbound mail. firstname An optional field interpreted as the first name of the person or group. It is used in fullname. lastname An optional field interpreted as the last name of the person or group. It is used in fullname. fullname A combination value made up from the firstname and lastname fields, in the form: firstname lastname. recognizes three types of alias names: A database entry that has one address in address-list. assumes this address is a valid mailing address. A database entry that has two or more addresses in address-list. assumes initially that these addresses are aliases to or entries. An address in a entry or an alias in alias-name-list that is not an alias in the database. In both cases, the item is reported as both the alias name and its address. With no options or operands, displays the address-list field for each alias in the two databases. If an entry has more than one alias, the address-list field is displayed multiple times. With an alias-name-list and no options, displays the address-list field of each alias name in the list. If an alias name is not found in the databases, it is treated as without comment. Options recognizes the following options: Change the display to alias name followed by address-list field. Turn debugging on. Fully expand aliases. This option can be used only when an alias-name-list is given. If an address in a address list is an alias name, it is replaced by that alias entry. The process is recursive until the results are either or types. If a address is not an alias name, it is reported as both the alias name and the address, with type Duplicate alias names are reported only once. entries are not expanded, even if their addresses are actually aliases. Display the format string for each alias name in the file or in the alias-name-list. The following character pairs are replaced in the format by the corresponding value for each alias. The alias name. The comment field. The lastname field. The fullname value. The alias type: or The address-list field. Change the display to address-list followed by fullname, if any, in parentheses. Report an error if a name in alias-name-list does not correspond to an alias in the database. Display a message for each unknown name and exit with a nonzero status. Use the system alias database only, unless is also specified. Use the user alias database only, unless is also specified. Use a verbose output format. Change the display to alias name, followed by address-list, followed by fullname, if any, in parentheses. Use a very verbose, multiline output format with the following titles, corresponding to the format codes of the option. If a field is empty, the title is omitted. EXIT STATUS
sets the following exit status values: Normal completion. An error occurred. You may have specified: o An invalid option. o The option without an alias-name-list. o The option without a format. o The option with an unknown alias name in alias-name-list. EXAMPLES
Consider a user database that contains the following entries: Since and do not refer to alias entries, they are typed as with no options or operands produces the following output. produces the alias names, address, and full name, as follows: To expand a set of aliases and format them with field titles, use the and options, as in the following command: producing: AUTHOR
was developed by HP. FILES
User alias database data table User alias database directory table User alias database hash table User alias source text System alias database data table System alias database directory table System alias database hash table System alias source text SEE ALSO
elm(1), newalias(1). elmalias(1)
All times are GMT -4. The time now is 01:56 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy