Sponsored Content
Full Discussion: Text editing/manipulation
Top Forums UNIX for Beginners Questions & Answers Text editing/manipulation Post 303040473 by yirgacheffe on Wednesday 30th of October 2019 03:40:24 AM
Old 10-30-2019
Text editing/manipulation

Hello all.
I need to rearrange a very long text file with the following format.
The number of lines in each block is variable, but is between 1 and 10.

Any hints what command could I use for this?
Thank you.



Code:
  SAMPLE      2600
  15    3453  159   3970  486   4327  760   4498
  1215  4638  1620  4707  1927  4882  2280  4967
  2564  5079  2894  5284  3229  5441  3846  5678

Code:
  SAMPLE      2800
  23    3446  140   3831  308   4172  526   4374
  853   4568  1177  4638  1716  4746  2321  4963
  2604  5111  2823  5284  3045  5410  3917  5788
  4486  5985  5141  6195

The desired output format is:


Code:
2600 15     3453  159   3970  486   4327  760   4498
1215   4638  1620  4707  1927  4882  2280  4967
2564   5079  2894  5284  3229  5441  3846  5678
2800 23     3446  140   3831  308   4172  526   4374
853    4568  1177  4638  1716  4746  2321  4963
2604   5111  2823  5284  3045  5410  3917  5788
4486   5985  5141  6195

Moderator's Comments:
Mod Comment
Code tags please! (trying to figure out what went wrong with the png files included...)

Last edited by Neo; 10-30-2019 at 05:13 AM.. Reason: deleted poorly formatted images
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Text Editing

Hello everybody, I have a sorted text file. some of the lines appear twice or even more. is there an unix utility that removes the extra appearences? Thanks, Ido. (7 Replies)
Discussion started by: ginodii
7 Replies

2. UNIX for Dummies Questions & Answers

Text editing on iPhone using ed

Hi all, I'm trying to edit a file using ed on an iphone. I am trying to edit a conf file and have managed to get to the directory where the default.conf file is located, however, when I type ed default.conf all i get is a number and then a blank line and a question mark which is why I am... (1 Reply)
Discussion started by: drewcifer
1 Replies

3. Shell Programming and Scripting

text file editing

Hi, I need some help in text manipulation. I have an input file like this: 7629 "WPCW 19 - CW/AM1, WPCB 40 - FAMN/CORNER, WPCB-DT1 50 - FAMN/CORNER, " W35AW - Various Shopping Pgms W41CF - TBN W47CV - TBN WLLS-LP 49 - AM1 WATCH WPXI 11 N & WPIX 11 CW 1234 "WPCW 19 - CW/AM1,... (26 Replies)
Discussion started by: injeti
26 Replies

4. Shell Programming and Scripting

Text editing script does everything but edit text.

I wrote this script to create and edit a large number of websites based on a template site and a collection of text files which have the relevant strings in them delimited by colons. I run it and the shell doesn't produce any errors, but when it gets to the for loop where it actually has to edit... (2 Replies)
Discussion started by: afroCluster
2 Replies

5. Shell Programming and Scripting

Editing text using AWK

France : 40 : John Persia : 50 : John -----Database What i am trying to achieve is to search for a book, and replave the title with the new title echo -n "Title:" read Title echo -n "Author:" read Author echo "new Title" read NewTitle awk 'BEGIN {... (11 Replies)
Discussion started by: gregarion
11 Replies

6. Shell Programming and Scripting

[HELP] Text manipulation... [HELP]

I need to know how can I remove all word after comma on each line. Like: jjkj,iiuiui,ijlkjkij,ookoo kijljlj,jhhkj,ijijkijkj,oijkijj kjkljlkj,kjkjlkjlkj,opok,okop to jjkj, kijljlj, ... (5 Replies)
Discussion started by: slutb3
5 Replies

7. UNIX for Dummies Questions & Answers

text manipulation help

Hello again unix.com How can I extract from a large file in format: steve@aol.com steve hawkins Location of this member is bla bla bla sun@hotmail.com Sun Ying This member is using browser bla bla bla to another text in format: steve@aol.com steve hawkins sun@hotmail.com sun ying ... (5 Replies)
Discussion started by: galford
5 Replies

8. Shell Programming and Scripting

Text manipulation help

Hello Unix.com, How can i generate links like this: i got http://upload.com/1/1.txt and i need to generate links from http://upload.com/1/1.txt to http://upload.com/1000/1000.txt Thanks in advance, Galford D. Weller (4 Replies)
Discussion started by: galford
4 Replies

9. UNIX for Dummies Questions & Answers

awk text editing

Dear all, I'm starting to learn programming, and I'm having some problem with awk text editing. I'm having a huge text file, and my goal is to print "something" before every 4th row starting from the second row. File example: AAAAA BBBBBB CCCCC DDDDD AAAAAAA BBBBBBBB CCCCCCC... (2 Replies)
Discussion started by: Higgo
2 Replies

10. Shell Programming and Scripting

Convert vi editing to text editing

Dear Guru's I'm using Putty and want to edit a file. I know we generally use vi editor to do it. As I'm not good in using vi editor, I want to convert the vi into something like text pad. Is there any option in Putty to do the same ? Thanks for your response. Srini (6 Replies)
Discussion started by: thummi9090
6 Replies
IRSEND(1)							   User Commands							 IRSEND(1)

NAME
irsend - basic LIRC program to send infra-red commands SYNOPSIS
irsend [options] DIRECTIVE REMOTE CODE [CODE...] DESCRIPTION
Asks the lircd daemon to send one or more CIR (Consumer Infra-Red) commands. This is intended for remote control of electronic devices such as TV boxes, HiFi sets, etc. DIRECTIVE can be: SEND_ONCE - send CODE [CODE ...] once SEND_START - start repeating CODE SEND_STOP - stop repeating CODE LIST - list configured remote items SET_TRANSMITTERS - set transmitters NUM [NUM ...] SIMULATE - simulate IR event REMOTE is the name of a remote, as described in the lircd configuration file. CODE is the name of a remote control key of REMOTE, as it appears in the lircd configuration file. NUM is the transmitter number of the hardware device. For the LIST DIRECTIVE, REMOTE and/or CODE can be empty: LIST "" "" - list all configured remote names LIST REMOTE "" - list all codes of REMOTE LIST REMOTE CODE - list only CODE of REMOTE The SIMULATE command only works if it has been explicitly enabled in lircd. -h --help display usage summary -v --version display version -d --device use given lircd socket [/var/run/lirc/lircd] -a --address=host[:port] connect to lircd at this address -# --count=n send command n times EXAMPLES
irsend LIST DenonTuner "" irsend SEND_ONCE DenonTuner PROG-SCAN irsend SEND_ONCE OnkyoAmpli VOL-UP VOL-UP VOL-UP VOL-UP irsend SEND_START OnkyoAmpli VOL-DOWN ; sleep 3 irsend SEND_STOP OnkyoAmpli VOL-DOWN irsend SET_TRANSMITTERS 1 irsend SET_TRANSMITTERS 1 3 4 irsend SIMULATE "0000000000000476 00 OK TECHNISAT_ST3004S" FILES
/etc/lirc/lircd.conf Default lircd configuration file. It should contain all the remotes, their infra-red codes and the corresponding timing and wave- form details. DIAGNOSTICS
If lircd is not running (or /var/run/lirc/lircd lacks write permissions) irsend aborts with the following diagnostics: "irsend: could not connect to socket" "irsend: Connection refused" (or "Permission denied"). SEE ALSO
The documentation for lirc is maintained as html pages. They are located under html/ in the documentation directory. lircd(8), mode2(1), smode2(1), xmode2(1), irrecord(1), irw(1), http://www.lirc.org. irsend 0.9.0-pre1 October 2010 IRSEND(1)
All times are GMT -4. The time now is 05:37 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy