1. two unix questions: split and inserting text in each file.
Dear Unix gurus,
I have to solve the following types of problem - which I'm hoping can
be solved more efficiently than my crude and inefficient ways of
solving. Basically I have lists in the order 20,000 records which I
need to run a SQL query involving 'WHERE' clause. My files/environment
is a Sun (OS 5.6) unix box.
SQL 'WHERE' clause can only accept 1000 records at a time - hence, I
need to split the list in individual files of 1000 records each.
Here is a sample input file - its a list, so each record is separated
by a new line character and there are no duplicates in the list.
When I use the split command as shown below
split -1000 InputFile
The resulting files get named as
question 1: how can I make the starting and ending line numbers appear
in the resulting output files. For example
if my Input file name is InputFile and has 20000 records, I would like
the resulting Output files named as
Upon running the split command, I now have 20 output files - each has
1000 records. I need to insert some text in each output file so to
convert them to .sql files. When I run the split command, the
resulting xaa, xab..etc files will obviously be in the same directory?
question - can anyone show me how to do this. An illustration is
xaa (sample file)
xaa.sql (resulting .sql file)
SELECT PART_NUMBER '|' DESCRIPTION FROM PARTS_TABLE where PART_NUMBER
2. Solaris on PC P200 vs Ppro20?
3. source code for Unix "split" command
4. What's the best way to save/load configuration?
5. Ho to log access_log to split file and based on split per-virtual-host !
6. XDR problem (on Linux): xdr_hyper (and xdr_uint) nonexistent.
7. trivial question on the split command
8. help on some libs
9. Unix slot and mcapos and hwconfig command files and questions????
10. Unix slot and mcapos and hwconfig commands files and questions???
11. unix slot and mcapos and hwconfig command files and questions.
12. Help W/Unix Shell Script - File Splitting Based on Text String
13. Splitting a unix-file