Sponsored Content
Top Forums Shell Programming and Scripting Append Multiple files with file name in the beginning of line Post 302880231 by rramkrishnas on Wednesday 18th of December 2013 08:54:34 AM
Old 12-18-2013
Append Multiple files with file name in the beginning of line

Hi,

I have multiple files having many lines like as bvelow:
Code:
file Name a.txt
abc    def
def    xyz
123   5678

Code:
file Name b.txt
abc def
def xyz
123 5678

I would like to append files in the below format to a new file:
Code:
file Name c.txt
a.txt:abc    def
a.txt:def    xyz
a.txt:123   5678
b.txt:abc def
b.txt:def xyz
b.txt:123 5678

like above input files I have apprx 500 files and each file does contain thousends of records, which need to be murged into single file

Please help
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Append (cat) to beginning of file ?

Hi, Fairly new to unix scripting, hoping to get some help. using AIX v5 Basically I have 3 files 1). Header record 2). many detail record 3). Trailer record My desired result is 1 file which contains Heaeder, Detail, Trailer Currenty I am using a series of: ... (8 Replies)
Discussion started by: CBZ
8 Replies

2. UNIX for Dummies Questions & Answers

Append to beginning of a file

Hi, I have a file x which is being upated continuously. I want to add file y in the file x but at the beginning of file x. file x file y After commands file x eeee aaaa aaaa gggg bbbb bbbb hhhh... (2 Replies)
Discussion started by: baanprog
2 Replies

3. UNIX for Dummies Questions & Answers

Count Number Of lines in text files and append values to beginning of file

Hello, I have 50 text files in a directory called "AllFiles" I want to make a program that will go inside of the "AllFiles" Directory and count the number of lines in each individual text file. Then, the program will calculate how many more lines there are over 400 in each text file and... (7 Replies)
Discussion started by: motoxeryz125
7 Replies

4. Shell Programming and Scripting

how to append blank line in multiple files in unix

Dear All- Please suggest a single unix command which can append blank line in multiple files. I need to achieve this using a single unix command and not a script Please do advice Regards, Suresh (2 Replies)
Discussion started by: sureshg_sampat
2 Replies

5. Shell Programming and Scripting

help needed with shell script to append to the end of a specific line in a file on multiple servers

Hi Folks, I was given a task to append three IP's at the end of a specific (and unique) line within a file on multiple servers. I was not able to do that with the help of a script. All I could was: for i in server1 server2 server3 server4 do ssh $i done I know 'sed' could be used to... (5 Replies)
Discussion started by: momin
5 Replies

6. Shell Programming and Scripting

how to append multiple lines to the last line of a file

Hello, This is what I am trying to achieve: file1 a b c d file2 e f g h (8 Replies)
Discussion started by: smarones
8 Replies

7. Shell Programming and Scripting

Append variable texts to the beginning of each line in all files in a directory

I am writing a code to append some numbers in the beginning of each line in all the files present in a directory. The number of files are really huge. The files are numbered as 1.sco, 2.sco, 4.sco (Note: 3.sco is missing). The files currently look like this: 1.sco 2 3 5 6 6 7My task is to... (4 Replies)
Discussion started by: shoaibjameel123
4 Replies

8. Shell Programming and Scripting

Read multiple files, parse data and append to a file

Hi..Can anyone suggest a simple way of achieving this. I have several files which ends with extension .vcf . I will give example with two files In the below files, we are interested in File 1: 38 107 C 3 T 6 C/T 38 241 C 4 T 5 C/T 38 247 T 4 C 5 T/C 38 259 T 3 C 6 T/C... (8 Replies)
Discussion started by: empyrean
8 Replies

9. Shell Programming and Scripting

Append file name to the beginning of each line

I want to append file names at the beginning of a line for each row file content abc.txt.gz 123|654|987 bcd.txt.gz 876|trf|kjh I want a single output file with below format abc.txt.gz|123|654|987 bcd.txt.gz|876|trf|kjh This one is working but only with unzip files,need to have... (3 Replies)
Discussion started by: rakesh5300
3 Replies

10. UNIX for Beginners Questions & Answers

Removing characters from beginning of multiple files

Hi, I have been searching how to do this but I can't seem to find how to do it. Hopefully someone can help. I have multiplr files, 100's example 12345-zxys.213423.zyz.txt. I want to be able to take all these files and remove the first '12345-' from each of the files. '12345-' these characters... (5 Replies)
Discussion started by: israr75
5 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:17 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy