Sponsored Content
Top Forums UNIX for Dummies Questions & Answers How to count the record count in an EBCDIC file. Post 302081637 by tmarikle on Wednesday 26th of July 2006 07:22:41 PM
Old 07-26-2006
One method using dd given that you know the record size of course:
Code:
$ dd if=ebcdic_file bs=$REC_SIZE > /dev/null

nnn+0 records in
nnn+0 records out

or
Code:
$ dd if=ebcdic_file cbs=$REC_SIZE conv=ascii | wc -l

     nnn


Last edited by tmarikle; 07-26-2006 at 08:27 PM..
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

record count

i have a file named file_names.dat where there are several files along with their path. exp: /data1/dir1/CTA_ACD_20071208.dat /data1/dir1/CTA_DFG_20071208.dat i want to write a script which will create a csv file with the name of the file and record count of that file the output file... (4 Replies)
Discussion started by: dr46014
4 Replies

2. UNIX for Dummies Questions & Answers

how to get a file name & record count of csv file

HI , I am new to shell scripting , I have a requirement that I send a file for data quality ( original.csv) & i will be getting 4 files daily into a particular directory in return with cleansed data . the files may be clean.csv, unclean.csv , ... (2 Replies)
Discussion started by: sirik
2 Replies

3. Shell Programming and Scripting

Record count of a csv file

Hello Gurus, We have a requirement to count the valid number of records in a comma delimited file with double quotes. The catch here is..few records have a new line carriage within the double quotes,,say for ex:we have a file called accounts the record count is 4827..but the actual valid count... (5 Replies)
Discussion started by: ajaykk
5 Replies

4. Shell Programming and Scripting

replaying a record count with another record count

i use unix command to take the record count for a file1 awk 'END{print NR}' filename i already have a file2 which conatin the count like ... .. rec_cnt=100 .. .. I want to replace the record in the file2 using the record i take from file1. suggest me some simple ways of doing it... (2 Replies)
Discussion started by: er_zeeshan05
2 Replies

5. Shell Programming and Scripting

Getting Sum, Count and Distinct Count of a file

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)
Discussion started by: singhabhijit
4 Replies

6. Shell Programming and Scripting

Validate record count

Hi all How to verify the number of records in case of delimited file, If the file has records. And then if it is not equal to mentioned no. of records, email is triggered and file is moved to bad directory path. Example ----- input file = a.txt bad directory path : /usr/bin/bad (6 Replies)
Discussion started by: balaji23_d
6 Replies

7. Shell Programming and Scripting

Character count per record

I have a flat file. How can i retrive the character count per record in whole file. Can anybody assist me on this Cheers (9 Replies)
Discussion started by: subrat
9 Replies

8. Shell Programming and Scripting

Print record count of a file using shell script

HI, I need to print the record count of a file using shell script. If the record count of a file excluding header and trailer record if greater than zero then print 'Record count of a file is xxxx records'. If the record count is zero print 'zero records' Thanks Mahendra (1 Reply)
Discussion started by: mmeda
1 Replies

9. Shell Programming and Scripting

Help with Getting distinct record count from a .dat file using UNIX command

Hi, I have a .dat file with contents like the below: Input file ============SEQ NO-1: COLUMN1========== 9835619 7152815 ============SEQ NO-2: COLUMN2 ========== 7615348 7015548 9373086 ============SEQ NO-3: COLUMN3=========== 9373086 Expected Output: (I just... (1 Reply)
Discussion started by: MS06
1 Replies

10. Shell Programming and Scripting

Total record count of all the file present in a directory

Hi All , We need one help on the below requirement.We have multiple pipe delimited .txt file(around 100 .txt files) present on one directory.We need the total record count of all the files present in that directory without header.File format as below : ... (8 Replies)
Discussion started by: STCET22
8 Replies
haveged(8)						  SYSTEM ADMINISTRATION COMMANDS						haveged(8)

NAME
haveged - Generate random numbers and feed linux random device. SYNOPSIS
haveged [options] DESCRIPTION
The HAVEGE (HArdware Volatile Entropy Gathering and Expansion) algorithum harvests the indirect effects of hardware events on hidden pro- cessor state (caches, branch predictors, memory translation tables, etc) to generate a random sequence. The effects of interrupt service on processor state are visible from userland as timing variations in program execution speed. Using a branch-rich calculation that fills the processor instruction and data cache, a high resolution timer source such as the processor time stamp counter can generate a random sequence even on an "idle" system. In Linux, the hardware events that are the ultimate source of any random number sequence are pooled by the /dev/random device for later distribution via the device interface. The standard mechanism of harvesting randomness for the pool may not be sufficient to meet demand, especially on those systems with high needs or limited user interaction. Haveged provides a daemon to fill /dev/random whenever the supply of random bits in /dev/random falls below the low water mark of the device. Haveged also provides a direct file system interface to the collection mechanism that is also useful in other circumstances where access to the dev/random interface is either not available or inappropriate. In either case, haveged uses HAVEGE to maintain a 1M pool of random bytes consumed by the interface. The principle inputs to havaged are the sizes of the processor instruction and data caches used to setup the HAVEGE collector. The haveged default is a 4kb data cache and a 16kb instruction cache. On machines with a cpuid instruction, haveged will attempt to select appropriate values from internal tables. Although CISC architectures appear insensitive to tuning parameters, there is no guarantee that manual tuning of the algorithm may not be required under some circumstances. The output of the HAVEGE random number generator should be verified on any installation before the haveged is put into production. OPTIONS
-b nnn, --buffer=nnn Set collection buffer size to nnn KB. Default is 128. -d nnn, --data=nnn Set data cache size to nnn KB. Default is 16 or as determined by cpuid. -f file, --file=file Set output file path for non-daemon use. Default is "sample", use '-' for stdout. -i nnn, --inst=nnn Set instruction cache size to nnn KB. Default is 16 or as determined by cpuid. -n nnn, --number=nnn Set number of bytes written to the outputfile. The value may be specified using one of the suffixes k, m, g, or t. The upper bound of this value is "16t" (2^44 Bytes = 16TB). A value of 0 indicates unbounded output and forces output to stdout. -r n, --run=n Set run level for daemon interface: n = 0 Run as daemon - must be root. Fills /dev/random when the supply of random bits falls below the low water mark of the device. This argument is required if the daemon interface is not present. If the daemon interface is present, this takes precedence over any -r value. n = 1 Display configuration info and terminate. n > 1 Write <n> kb of output. Deprecated (use -n instead), only provided for backward compatibility. -v n, --verbose=n Set output level 0=minimal, 1=config/fill items, use -1 for all diagnostics. -w nnn, --write=nnn Set write_wakeup_threshold of daemon interface to nnn bits. Applies only to run level 0. -?, --help This summary of program options. DIAGNOSTICS
The following diagnostics may be issued to stderr upon termination: Cannot fork into the background Call to daemon(3) failed. Cannot open file <s> for writing. Could not open sample file <s> for writing. Cannot write data in file: Could not write data to the sample file. Couldn't get poolsize. Unable to read /proc/sys/kernel/random/poolsize Couldn't initialize HAVEGE rng Invalid data or instruction cache size. Couldn't open random device Could not open /dev/random for read-write. Couldn't query entropy-level from kernel: error Call to ioctl(2) failed. Couldn't open PID file <path> for writing Error writing /var/run/haveged.pid Fail:set_watermark() Unable to write to /proc/sys/kernel/random/write_wakeup_threshold RNDADDENTROPY failed! Call to ioctl(2) to add entropy failed Select error Call to select(2) failed. EXAMPLES
Write 1.5MB of random data to the file /tmp/random haveged -n 1.5M -f /tmp/random Generate a /tmp/keyfile for disk encryption with LUKS haveged -n 2048 -f /tmp/keyfile Overwrite partition /dev/sda1 with random data. Be careful, all data on the partition will be lost! haveged -n 0 | dd of=/dev/sda1 Generate random ASCII passwords of the length 16 characters (haveged -n 1000 -f - 2>/dev/null | tr -cd '[:graph:]' | fold -w 16 && echo ) | head Write endless stream of random bytes to the pipe. Utility pv measures the speed by which data are written to the pipe. haveged -n 0 | pv > /dev/null Evaluate speed of haveged to generate 1GB of random data haveged -n 1g -f - | dd of=/dev/null Create a random key file containing 65 random keys for the encryption program aespipe. haveged -n 3705 -f - 2>/dev/null | uuencode -m - | head -n 66 | tail -n 65 Test the randomness of the generated data with dieharder test suite haveged -n 0 | dieharder -g 200 -a SEE ALSO
cryptsetup(8), aespipe(1), pv(1), openssl(1), uuencode(1) AUTHOR
Gary Wuertz <gary@issiweb.com> and Jirka Hladky SEE ALSO
http://www.issihosts/haveged/ version 1.3 October 23, 2011 haveged(8)
All times are GMT -4. The time now is 11:03 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy