based on the first column, I want to create files. in this example 1 is repeated three times and create file groupnumber_1.csv and this file has data only belongs to 1
groupnumber_1.csv
1,12345
1,34567
1,23456
and one more file I have to create groupnumber_2.csv
2,67890
2,77720
2,44556
2,55668
one more file groupnumber_10.csv
10,44996
etc this way I have to create as many as csv files based on ths first column.
A pitfall of these solutions is that they will fail if they reach the open file resource limit. If there are many files to be created or if the alllowed number of open files per process is low and cannot be raised, they may require the addition of a close after the print.
Dude Alister ... always nitpicking ... but still always true !
Under solaris :
rlim_fd_max
Description Specifies the �hard� limit on file descriptors that a single process might
have open.Overriding this limit requires superuser privilege.
Data Type Signed integer
Default 65,536
Range 1 to MAXINT
Units File descriptors
Dynamic? No
Validation None
When to Change When the maximum number of open files for a process is not enough.
Other limitations in system facilities can mean that a larger number of
file descriptors is not as useful as it might be. For example:
A 32-bit program using standard I/O is limited to 256 file
descriptors. A 64-bit program using standard I/O can use up to 2
billion descriptors. Specifically, standard I/O refers to the
stdio(3C) functions in libc(3LIB).
select is by default limited to 1024 descriptors per fd_set. For
more information, see select(3C). Starting with the Solaris 7
release, 32-bit application code can be recompiled with a larger
fd_set size (less than or equal to 65,536). A 64-bit application uses
an fd_set size of 65,536, which cannot be changed.
This is good. but I am trying to remove the First column after the files are generated. can we add anything to the above command. can you help me in this. Plz?
Thanks, But This command has limitation. on the test file it is working perfect. but when I am trying to work on the actual file, I can not create more than 25 files. it has some limit.
can we write loop logic on this. Please suggest me.
What I mean is that when you run the command again, and if output files already exist, it will append new records to these existing files rather than overwrite them.