Welcome to forums, request you to please use code tags as per forum rules for commands/codes/Inputs which you are using into your posts. For your requirement, could you please try following.
Second solution will leave all empty lines and will not count them. So output will be as follows.
Thanks,
R. Singh
Hi,
I have a script which removes 2 header records and 1 trailer record in a list of files. The commands doing the actions are
sed '1,2d' $file > tempfile1.dat
sed '$d' < tempfile1.dat > $output.txt
Its working fine for all records except a file having size=1445509814 and number of... (2 Replies)
Hi all this is a UNIX question.
I have a large flat file with millions of records.
col1|col2|col3
1|a|b
2|c|d
3|e|f
3|g|h
footer****
I am supposed to calculate the sum of col1 1+2+3+3=9, count of col1 1,2,3,3=4, and distinct count of col1 1,2,3=c3
I would like it if you avoid... (4 Replies)
Hi All,
when i ftp the file from windows machine to unix server the record count in the file is decreased by 1.
example: Say a text file has three lines in it and when you place this file in unix server from your local machine and run a below command
cat filename | wc -l
the output is... (2 Replies)
Could you please tell e how to find the total number of rows in a .dat file.
edit by bakunin: this is exactly why in "advanced and expert" section?? I transfer this thread to "Unix for Dummies Questions and Answers" (2 Replies)
Hi All,
I thinking on how to accelerate the speed on calculate the dat file against the number of records CTRL file.
There are about 300 to 400 folder directories that contains both DAT and CTL files.
DAT contain all the flat files records
CTL is the reference check file for the... (3 Replies)
Hi All ,
I have multiple pipe delimited csv files are present in a directory.I need to find out distinct count on a column on those files and need the total distinct
count on all files.
We can't merge all the files here as file size are huge in millions.I have tried in below way for each... (9 Replies)
Hi Everyone,
I am looking for awk command to retrieve only the record number 23 and record number 89 from a unix file? Please let me know what is the awk command for this?
Regards
Rakesh (1 Reply)
Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted!
1. The problem statement, all variables and given/known data:
I am looking for awk command to retrieve only the record number 23 and record number 89 from a unix file?... (6 Replies)