Hi ,
How to replace all entries of comma in text file by space or other character.
cat temp.txt
A,B,C,D
I want this file to be like
A B C D
Please help!!! (4 Replies)
Hi all,
I'm hoping you can help.. I've used this forum a couple of times and I am back again now i've moved onto something more complex (for me!)
I have some data which looks like:
"AL1_1,AL1_1,"
"AL1_1.AL1_1A.AL1_1AE,AL1_1AE,"
"AL1_1.AL1_1A.AL1_1AG,AL1_1AG,"
"AL1_1.AL1_1A.AL1_1AJ,AL1_1AJ,"... (10 Replies)
arr_Ent_NameId variable holds 'Prakash pawar' 'sag' '23' '50000' this value
'Prakash pawar' 'sag' '23' '50000' I want to replace space( ) with comma (,)
There are 4 fields here. I don't want to replace first field with comma.
output should be: 'Prakash,pawar','sag','23','50000'
... (2 Replies)
I have a csv file and there is a problem which I need to resolve.
Column1,Column2,Colum3,Column4
,x,y,z
,d,c,v
t,l,m,n
,h,s,k
,k,,y
z,j, ,p
Now if you see column1 for row 1 and row 4 though they are null there is a space but in case of row2 and row 5 there is no space.
I want row... (3 Replies)
hi
i want to replace spaces by comma
my file is
ADD 16428 170 160 3 WNPG 204 941 No 204802
ADD 16428 170 160 3 WNPG 204 941 No 204803
ADD 16428 170 160 3 WNPG 204 941 No 204804
ADD... (9 Replies)
Hi,
i want to replace comma by space for specified field in record, i mean i want to replace the commas in the 4th field by space. and rest all is same throught the record.
the record is
16458,99,001,"RIMOUSKI, QC",418,"N",7,EST,EDT,902
16458,99,002,"CHANDLER,... (5 Replies)
Hello everyone,
I want to replace all "," (commas) with a blank space
My command thus far is:
cat test.text | sed -e s/\`//g | awk '{print$1" "$2" "$3}'
I'm sure you guys know this, but the SED command that I am using is to get rid of the "`" (tics).
which gives me:
name ... (5 Replies)
I,
I have a file and i need to replace comma and blank space with comma and 0.
cat file.txt
a,5
b,1
c,
d,
e,4
I need the output as
cat file.txt
a,5
b,1
c,0
d,0 (4 Replies)
I have a comma delimited file of major codes and descriptions. I want to replace all occurrences of spaces with underscores up to the first comma (only in the first field), but not replace spaces following the comma. For instance I have the following snippet of the file:
EK ED,Elementary and... (7 Replies)
I have the content of this file that i would like to replace the space by comma.
The file content values in this format
FName LName Date & time
------------------------------------
Gilles John 14/12/17 12:30:45
I want this format
Fname,LName,Date&time... (7 Replies)
Discussion started by: gillesi
7 Replies
LEARN ABOUT OSF1
scandir
scandir(3) Library Functions Manual scandir(3)NAME
scandir, alphasort - Scans or sorts directory contents
LIBRARY
Standard C Library (libc.a)
SYNOPSIS
#include <sys/types.h> #include <sys/dir.h>
int scandir ( char *dir_name, struct dirent * (*name_list[ ]), int (*select) ( struct dirent *dir ), int (*compare) (
struct dirent **dir1, struct dirent **dir2 ) );
int alphasort ( struct dirent **dir1, struct dirent **dir2 );
PARAMETERS
Points to the directory name. Points to the array of pointers to directory entries. Points to a user-supplied function that is called by
the scandir() function to select which entries to include in the array. Points to a user-supplied function that sorts the completed
array. Points to a dirent structure. Points to a dirent structure.
DESCRIPTION
The scandir() function reads the directory pointed to by the dir_name parameter. It then uses the malloc() function to create an array of
pointers to directory entries. The scandir() function returns the number of entries in the array and, through the name_list parameter, a
pointer to the array.
The select parameter points to a user-supplied function that the scandir() function calls to select which entries to include in the array.
The selection routine is passed a pointer to a directory entry and returns a nonzero value for a directory entry that is included in the
array. If the select parameter is a null value, all directory entries are included.
The compare parameter points to a user-supplied function that is passed to the qsort() function to sort the completed array. If the compare
parameter is a null value, the array is not sorted.
The memory allocated to the array can be deallocated by freeing each pointer in the array, and the array itself, with the free() function.
The alphasort() function alphabetically compares the two dirent structures pointed to by the dir1 and dir2 parameters. This function can be
passed as the compare parameter to either the scandir() function or the qsort() function. A user-supplied subroutine may also be used.
RETURN VALUES
The scandir() function returns -1 if the directory cannot be opened for reading or if the malloc() function cannot allocate enough memory
to hold all the data structures. If successful, the scandir() function returns the number of entries found.
The alphasort() function returns the following values: Less than 0 (zero): The dirent structure pointed to by the dir1 parameter is lexi-
cally less than the dirent structure pointed to by the dir2 parameter. 0 (zero): The dirent structures pointed to by the dir1 parameter
and the dir2 parameter are equal. Greater than 0 (zero): The dirent structure pointed to by the dir1 parameter is lexically greater than
the dirent structure pointed to by the dir2 parameter.
RELATED INFORMATION
Functions: malloc(3), opendir(3), qsort(3) delim off
scandir(3)