Sponsored Content
Top Forums Shell Programming and Scripting Need a helping hand --stuck in starting of this problm. Post 302088783 by anbu23 on Thursday 14th of September 2006 11:25:28 AM
Old 09-14-2006
Code:
n = split( man_col,man_col_arr,",")

breaks man_col into pieces stored in successive elements of array man_col_arr, where the pieces lie between substrings matched by the regular expression ","

The function return value is the number of elements in the array man_col_arr

i/p : man_col="1,3,5"
o/p :
man_col_arr[1]=1
man_col_arr[2]=3
man_col_arr[3]=5

Code:
 if ( $man_col_arr[i] == "" )

here we are checking the mandatory field is empty.
If yes then print record number and then close the file.
 

7 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Need a hand. Please?

i have a script in sh. with awk, e.g. want to list all the contents of a subdirectory an a tabular way. ej: outoput directory1 subdirectory1 subdirectory2 subdirectory3 file1 filen file2 filez file2 ... filen+1 ... (1 Reply)
Discussion started by: alexcol
1 Replies

2. IP Networking

helping new Linux users remotely ?

I volunteer with a small charity which locally donates refurbished computers to people who normally could not afford their own computer. Most of these computers now have Linux on them. We are in the process of remastering Xubuntu 9.04 to use as our main distro from now on. In the past any time... (3 Replies)
Discussion started by: lagagnon
3 Replies

3. Shell Programming and Scripting

Helping in parsing subset of text from a big results file

Hi All, I need some help to effectively parse out a subset of results from a big results file. Below is an example of the text file. Each block that I need to parse starts with "reading sequence file 10.codon" (next block starts with another number) and ends with **p-Value(s)**. I have given... (1 Reply)
Discussion started by: Lucky Ali
1 Replies

4. Shell Programming and Scripting

cut operation is not helping me much

hi, i have a file where I want to extract the the failure count only from the file. JOB_NAME STATE RUN_COUNT FAILURE_COUNT ------------------------------ --------------- ---------- ------------- OFS_BALA_BILLING_IN SCHEDULED 22992 ... (6 Replies)
Discussion started by: gotam
6 Replies

5. Shell Programming and Scripting

Merge left hand strings mapping to different right hand strings

Hello, I am working on an Urdu to Hindi dictionary which has the following structure: a=b a=c n=d n=q and so on. i.e. Headword separated from gloss by a = I am giving below a live sample بتا=बता بتا=बित्ता بتا=बुत्ता بتان=बतान بتان=बितान بتانا=बिताना I need the following... (3 Replies)
Discussion started by: gimley
3 Replies

6. Shell Programming and Scripting

Helping a Newbie with Shell Homework

Good Evening, i got a homework where i have to list all files in the directory with the name length >=3 and <= 6 and after trying it for 2 days my Prof gave me a bit of code: #!/bin/bash for file in $(ls) do done after that he told me "now you only have to use wc and you got it" but... (1 Reply)
Discussion started by: Mentoss
1 Replies

7. UNIX for Dummies Questions & Answers

How to grep a line not starting with # from a file (there are two lines starting with # and normal)?

e.g. File name: File.txt cat File.txt Result: #INBOUND_QUEUE=FAQ1 INBOUND_QUEUE=FAQ2 I want to get the value for one which is not commented out. Thanks, (3 Replies)
Discussion started by: Tanu
3 Replies
IMPLODE(3)								 1								IMPLODE(3)

implode - Join array elements with a string

SYNOPSIS
string implode (string $glue, array $pieces) DESCRIPTION
string implode (array $pieces) Join array elements with a $glue string. Note implode(3) can, for historical reasons, accept its parameters in either order. For consistency with explode(3), however, it may be less confusing to use the documented order of arguments. PARAMETERS
o $glue - Defaults to an empty string. o $pieces - The array of strings to implode. RETURN VALUES
Returns a string containing a string representation of all the array elements in the same order, with the glue string between each ele- ment. EXAMPLES
Example #1 implode(3) example <?php $array = array('lastname', 'email', 'phone'); $comma_separated = implode(",", $array); echo $comma_separated; // lastname,email,phone // Empty string when using an empty array: var_dump(implode('hello', array())); // string(0) "" ?> NOTES
Note This function is binary-safe. SEE ALSO
explode(3), preg_split(3), http_build_query(3). PHP Documentation Group IMPLODE(3)
All times are GMT -4. The time now is 06:08 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy