Awk,sed,shell copy ID in new lines


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Awk,sed,shell copy ID in new lines
# 1  
Old 02-05-2018
Awk,sed,shell copy ID in new lines

Hi all

i want table file in pattern like under
Code:
ID(digits and underline) phonetic begin_byte(only plus number) end_byte(only plus number)

but
ID loose in next lines of my file
my input file like this:
Code:
input
001_1_174 [g/n 474536 482492
mo[g/n 482492 504062
'er/  504062 517352
ruze 517352 529562
001_1_175 uz[`f 960192 966656
.ire 966656 984416
tuf/[ 984416 1006166

i want copy ID in new line. copy ID of first column in next new line until next new ID.
something like this
Code:
001_1_174 [g/n 474536 482492
001_1_174 mo[g/n 482492 504062
001_1_174 'er/ 504062 517352
001_1_174 ruze 517352 529562
001_1_175 uz[`f 960192 966656
001_1_175 .ire 966656 984416
001_1_175 tuf/[ 984416 1006166

# 2  
Old 02-05-2018
Rules and requirements as explained by Don Cragun didn't change ever since he closed your other thread.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

awk copy first column in new lines

Hi all i have table like this input001_1_174 j 474536 482492 mo001_1_175 j 960192 966656 .ire 966656 984416 .uf/i want copy number of first line to other line... (10 Replies)
Discussion started by: alii
10 Replies

2. Shell Programming and Scripting

Use sed/awk to do like copy and paste

I have rrd file which is have the gaps and I want to fill it out with some value , I've got 10 NaN record and I try to populate data from 10 records be for NaN to change instead of NaN :( <!-- 2016-05-19 14:10:00 CST / 1463638200 -->... (11 Replies)
Discussion started by: boobytrap
11 Replies

3. Shell Programming and Scripting

Merge files and copy some data using sed or awk

Copy data from other file to paste cat file1: Name: server1.data.com data1 server1 running Name: server3.data.com data3 server3 running cat file2: server1 good server2 bad network not ok server3 good Output: (10 Replies)
Discussion started by: kenshinhimura
10 Replies

4. Shell Programming and Scripting

Summing over specific lines and replacing the lines with the sum using sed, awk

Hi friends, This is sed & awk type question. I have a text file which has numbers spread all over the file. I want to sum the series of numbers whenever i find it and produce an output file with the sum. For example ###start of input text file #### abc def ghi 1 2 3 4 kjld random... (3 Replies)
Discussion started by: kaaliakahn
3 Replies

5. Shell Programming and Scripting

Sed/awk to delete single lines that aren't touching other lines

Hello, I'm trying to figure out how to use sed or awk to delete single lines in a file. By single, I mean lines that are not touching any other lines (just one line with white space above and below). Example: one two three four five six seven eight I want it to look like: (6 Replies)
Discussion started by: slimjbe
6 Replies

6. UNIX for Dummies Questions & Answers

How to use sed to copy specific lines from a file using shell variables?

hello! I am trying to use sed to copy specific set of lines from a file for which the starting and ending line numbers of the lines to be copied are stored in shell variables. How can i copy those lines? if the input_file is something like this and if the following is the script a=2 b=4... (4 Replies)
Discussion started by: a_ba
4 Replies

7. Shell Programming and Scripting

copy, then delete lines in file with sed using a pattern

I need to copy lines to a new file from files with sed using a pattern in char postions 1-3. Then after the copy, I need to delete those same lines from the input files. For example, string "ABC" in pos 1-3 (6 Replies)
Discussion started by: laksjfhoius9123
6 Replies

8. Shell Programming and Scripting

Solaris KSH shell script to copy all lines from one file to another

Hello, more of a windows wscript guy. However I took a new position that requires me to support some solaris servers. So... issue is that I need to copy all lines from a file to a temporary file and then copy them back into the original file starting at line 1. Reason I need to do this is... (5 Replies)
Discussion started by: ZigZaggin
5 Replies

9. Shell Programming and Scripting

awk/grep copy and paste and insert in between lines.

Hi all, I'm a unix newb andI'm trying to write a script that can copy some text paste it in a certian place and then add a number. It's not really clear but I'll show an example. what the file looks like right now: Linux 2.6.24-24-generic (abc) 07/15/09 23:25:01 CPU ... (6 Replies)
Discussion started by: the1hand3r
6 Replies

10. Shell Programming and Scripting

How to copy multiple lines from a file to another using AWK?

Hi, I have a abc.txt file. In this file there is a SQL query which Iwant to copy and print it on another file.The query (for eg) is written like this: SELECT field1, field2, field3 from table1,table2 where <conditions> END I want to copy this query to another... (3 Replies)
Discussion started by: jisha
3 Replies
Login or Register to Ask a Question