I am running into an issue. I have a very big file. Wants to split it in smaller chunks. This file has multiple header/ trailers. Also, between each header/trailer there are records. Number of records in each header trailer combination can vary. Also, headers can start with 202XXXXXXXXXXXXXXX, same for trailer.
Records start like 1101XXXXXXXXXXXXXXX.
I want to split file say like
Say last 8 records are like
My script should put till record 3 in first file and records from 4 onwards in the next file as maching trailer for header starting at record 4 is missing.
Can someone help. Please ask all queries.
Regards
Last edited by Scott; 08-08-2013 at 12:05 PM..
Reason: Added Code tags [7th time]
Hi All,
I need to extract the data from the text file. The data of the text file is shown below
#L 0.000017 4.329939 0.000017 4.716267 r7.9 P 1 1;Net=IN32
The extracted data should be IN32. Could anyone help to script in c shell.? (4 Replies)
Below is my script that works fine and prints the desired output:
#!/bin/ksh
echo "$1" |
while IFS= read -r dirpath
do
echo "DIRR_PATH:$dirpath"
install_dir=$install_dir" "$dirpath
done
echo "Desired Output:$install_dir"
Output:
./loopissue.sh... (10 Replies)
Dear all,
My work is completely stuck cos of the following issue. Please find it here and kindly help me.
Task is following:
I have set of files with such pattern
1t-rw-rw-r-- 1 emily emily 119 Jun 11 10:45 vgtree_5_1_pfs.root
3t-rw-rw-r-- 1 emily emily 145 Jun 11 10:46 vgtree_5_3_pfs.root... (4 Replies)
Hi Team,
I am trying to cut a large file into multiple files. It has
Header
50,050 records
Trailer
-------------------------------------------
I need to cut the files into multiple files of 1000 records and should have the same header and trailer as the original files.
... (4 Replies)
I have a single record large file, semicolon ';' and pipe '|' separated. I am doing a vi on the file. It is throwing an error "File to long"
I need to actually remove the last | symbol from this file.
sed -e 's/\|*$//' filename
is working fine for small files. But not working on this big... (13 Replies)
I have a huge file semicolon( ; ) separated records are Pipe(|) delimited.
e.g
abc;def;ghi|jkl;mno;pqr|123;456;789
I need to replace the 50th field(semicolon separated) of each record with 9006. The 50th field can have no value e.g. ;;
Can someone help me with the appropriate command. (3 Replies)
Hi,
I am trying to write a script to cleanup files in a log directory ..
cd log
find Datk** -mtime +7 -exec rm -f {} \; 2> /dev/null
Have used the above to clean up files in log directory more then 7 days older.
The file can be something like ( auto-generate by some processes and... (2 Replies)
I have been doing automation of daily check activity for a server, i have been using sqls to retrive the data and while loop for reading the data from the file for several activities. BUT i got a show stopper the below one.. where the data is getting store in $temp_file, but not being read by while... (1 Reply)
sir i have to get first line from a file
for example
>cat file1
abc
zxc
asd
adsf
from that file1 i need only first line
expected result
>abc
please help me ! (1 Reply)
Hi all,
I have a problem in handling files through C.
here is the problem im having:
i will query the database (for instance consider employees table )
for empno,ename,job,salary fields.The query returns me some 100 of rows. now i need to place them in a file in row wise pattern as they... (3 Replies)