Sponsored Content
Top Forums Shell Programming and Scripting Add a newline after every period Post 302733143 by Chubler_XL on Monday 19th of November 2012 09:57:39 PM
Old 11-19-2012
Try this:

Code:
sed -e 's/\.  */.\n/g' -e 's/\.$/.\n/g' infile

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

grep and sed to find a pattern and add newline

Hello All, I have log file the result from a multithreaded process. So when a process finishes it will write to this log file as 123 rows merged. The issue is sometimes the processess finish at the same time or write to the file at the same time as 123 rows merged.145 rows merged. At... (5 Replies)
Discussion started by: ssikhar
5 Replies

2. Shell Programming and Scripting

add newline in file after finding specific text

Hi All, I am tring to insert a newline with "/" in a text file whenever there is the text "end;" right now I have inside file: . . end; I want to have: . . end; / I tried doing the following within the file :g/^end;/s//end; \/ / (4 Replies)
Discussion started by: jxh461
4 Replies

3. UNIX for Dummies Questions & Answers

How can I add a newline In a text file using Shell Script

Good day ... Well i do have this project in school, in our Principles Of Operating System Class We are using Cygwin.... And our project goes like this... Create a dictionary using cygwin. Display the following menu at the start of execution 1-add a word in the dictionary # specify... (1 Reply)
Discussion started by: kpopfreakghecky
1 Replies

4. Shell Programming and Scripting

How can I add a newline In a text file using Shell Script

Good day ... Well i do have this project in school, in our Principles Of Operating System Class We are using Cygwin.... And our project goes like this... Create a dictionary using cygwin. Display the following menu at the start of execution 1-add a word in the dictionary # specify the... (1 Reply)
Discussion started by: kpopfreakghecky
1 Replies

5. Shell Programming and Scripting

Add newline to regex

I have a perl script that runs a program and puts the output of the program into a variable. The output of the file looks like: Statistics 0 AverageTime: Statistics 0 AverageTime: I'm trying to run a regular express against this to pull out the first value in each of the parens... (1 Reply)
Discussion started by: Boomn4x4
1 Replies

6. UNIX for Dummies Questions & Answers

How to add newline before and after a special character?

So I have a file that contains >NM_#########AUGCAUCGUAGCUAGUCGAUACUGGACUG>NM_########AUGAGUAUGUAUGAUGUAUGUAUGA where # is any digit 0-9 (the text is many repetitions of the pattern above, not just that, but all in one line), and I want it to show >NM_#########... (2 Replies)
Discussion started by: ShiGua
2 Replies

7. UNIX for Dummies Questions & Answers

Mac OS X sed, add newline after pattern

Hi, I've been trying to work out how to add a new line to a file when the pattern matches .dmg. I've been searching Google but yet not found a working solution. Help would be appreciated... (9 Replies)
Discussion started by: pburge
9 Replies

8. Shell Programming and Scripting

How to add newline character at end of file?

Hi All, I have following piece of code in UNIX C Shell script and I want to add one more command which can add newline at the end of file only if there is no newline character exists. foreach file (`ls $dd_PLAYCARD_EDI_IN`) if ( -f $dd_PLAYCARD_EDI_IN/${file} ) then cat -n... (4 Replies)
Discussion started by: jnrohit2k
4 Replies

9. Shell Programming and Scripting

Add newline before another line of occurance

Hi , I have a file like I want to add a new line before "Realized" only when it comes after "Sheep". There may be any line betwwen "Sheep" and "Realized" other than this two. Say my new line is "a goat", so the desired result would be Can any body help me in this? thanks (10 Replies)
Discussion started by: arup1980
10 Replies

10. UNIX for Dummies Questions & Answers

Occurrences of if a value in 24 hr period

The following is a sample of the data I am working with: ID#___Hour ID=10008 19 ID=10008 20 ID=10014 19 ID=10014 20 ID=21047 20 Need to get the following output: ID#_______0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23 ID=10008 ------------------**--- ID=10014 ... (4 Replies)
Discussion started by: c@rlos
4 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 02:45 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy