Sponsored Content
Full Discussion: Check length of record
Top Forums Shell Programming and Scripting Check length of record Post 302341782 by jim mcnamara on Thursday 6th of August 2009 02:52:39 PM
Old 08-06-2009
Code:
awk ' length($0)!=58 {print FNR, $0}' inputfile

 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

fixed record length

hello! I have a file with fixed record length... format: 123445asdfg 4343777 sfgg I wanna convert it to 123445,asdfg ,4343,777 ,sfgg is there any way to do it? sed/grep/awk?? at the moment I use sed -e 's_ \(\)_,\1_g' but it works only if there are spaces between... (16 Replies)
Discussion started by: george_
16 Replies

2. UNIX for Dummies Questions & Answers

What the command to find out the record length of a fixed length file?

I want to find out the record length of a fixed length file? I forgot the command. Any body know? (9 Replies)
Discussion started by: tranq01
9 Replies

3. Shell Programming and Scripting

Make variable length record a fixed length

Very, very new to unix scripting and have a unique situation. I have a file of records that contain 3 records types: (H)eader Records (D)etail Records (T)railer Records The Detail records are 82 bytes in length which is perfect. The Header and Trailer records sometimes are 82 bytes in... (3 Replies)
Discussion started by: jclanc8
3 Replies

4. Shell Programming and Scripting

Viewing a record of particular length

I have records with different lengths say 386, 387 and 388. Do i have any command to view all the records of the length 386 ? Please do advise. Thanks (2 Replies)
Discussion started by: bobby1015
2 Replies

5. Shell Programming and Scripting

Record length

Hi, The record length may be differ in afile. I want to display the records if the record length is not equal to 50 using sed/awk command. Thanks in Advance (6 Replies)
Discussion started by: NareshN
6 Replies

6. Shell Programming and Scripting

Check for length which exceeds specified length in a line

Hi, I have a issue, I need to loop through a comma delimited file and check for the length which exceeds specified length , if Yes truncate the string. But my problem is , I do not have to check for all the fields and the field lenght is not same for all the fields. For ex: Say my line... (9 Replies)
Discussion started by: rashmisb
9 Replies

7. Shell Programming and Scripting

Record length check fails due to '\' character

When I check the length for the records in the file, it does not give me the correct value. I used wc -l command. Example records: abcdefghij abcd\efghij abcdefghi Expected output is: 10 11 9 But the output returned is 10 10 9 Please help me on this issue. (10 Replies)
Discussion started by: Amrutha24
10 Replies

8. Shell Programming and Scripting

Verifying Record Length

Hi all, We are going through a total migration from AIX-based server framework to Linux-based servers. When I am testing *.sh and *.awk in a lower environments, it abends at the same step everytime in verifying the record length of the first row of the source file. I know this source file... (11 Replies)
Discussion started by: SoloXX
11 Replies

9. Shell Programming and Scripting

Convert variable length record to fixed length

Hi Team, I have an issue to split the file which is having special chracter(German Char) using awk command. I have a different length records in a file. I am separating the files based on the length using awk command. The command is working fine if the record is not having any... (7 Replies)
Discussion started by: Anthuvan
7 Replies
one-bit-instrument(7)						  Numm Tutorials					     one-bit-instrument(7)

NAME
one bit instrument - how to make a gnarly synth with numm-run SYNOPSIS
numm-run FILE DESCRIPTION
In this tutorial we will learn how to live-code a one-bit synthesizer controlled by mouse position. It is intended as a gentle introduc- tion to development with numm-run. To get started, create a text file with the following method stubs: def audio_out(a): pass def video_out(a): pass Save the file as onebit.py, and then launch it with numm-run: numm-run onebit.py You should see a blank window appear. We will now make some sound and light by changing the value of a in the audio_out and video_out functions: def audio_out(a): a[::100] = 2**15 def video_out(a): a.flat[::100] = 255 Save the file, and you should see and hear the sketch update. This is using numpy's array-indexing to turn every hundredth audio sample and pixel-color on. The audio sample rate is by default 44100Hz, so it produces a series of clicks that will be perceived as a 441Hz tone. We can turn this into an instrument by connecting mouse motion to frequency: period = 100 def audio_out(a): a[::period] = 2**15 def video_out(a): a.flat[::period] = 255 def mouse_in(type,px,py,button): global period period = px*1000 Finally, let's use the keyboard to record and jump to notes. The first time you press a key, it records the period, and subsequant depres- sions play the saved period: period = 100 record = {} def audio_out(a): a[::period] = 2**15 def video_out(a): a.flat[::period] = 255 def mouse_in(type,px,py,button): global period period = px*1000 def keyboard_in(type,key): global period if record.has_key(key): period = record[key] elif record.has_key(key): record[] = period SEE ALSO
numm-run(1), numm.getting-started(7), numm.spectral-analysis(7) numm February 2012 one-bit-instrument(7)
All times are GMT -4. The time now is 06:30 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy