Sponsored Content
Full Discussion: Text editing/manipulation
Top Forums UNIX for Beginners Questions & Answers Text editing/manipulation Post 303040489 by RudiC on Wednesday 30th of October 2019 08:38:49 AM
Old 10-30-2019
Try
Code:
awk '/SAMPLE/ {printf "%s", $2; next} {$0 = "\t" $0; print}'  file

This User Gave Thanks to RudiC For This Post:
 

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
ELVREC(1)						      General Commands Manual							 ELVREC(1)

NAME
elvrec - Recover the modified version of a file after a crash SYNOPSIS
elvrec [preservedfile [newfile]] DESCRIPTION
If you're editing a file when elvis dies, the system crashes, or power fails, the most recent version of your text will be preserved. The preserved text is stored in a special directory; it does NOT overwrite your text file automatically. The elvrec program locates the preserved version of a given file, and writes it over the top of your text file -- or to a new file, if you prefer. The recovered file will have nearly all of your changes. To see a list of all recoverable files, run elvrec with no arguments. FILES
/usr/preserve/p* The text that was preserved when elvis died. /usr/preserve/Index A text file which lists the names of all preserved files, and the names of the /usr/preserve/p* files which contain their preserved text. BUGS
elvrec is very picky about filenames. You must tell it to recover the file using exactly the same pathname as when you were editing it. The simplest way to do this is to go into the same directory that you were editing, and invoke elvrec with the same filename as elvis. If that doesn't work, then try running elvrec with no arguments, to see exactly which pathname it is using for the desired file. Due to the permissions on the /usr/preserve directory, on UNIX systems elvrec must be run as superuser. This is accomplished by making the elvrec executable be owned by "root" and setting its "set user id" bit. If you're editing a nameless buffer when elvis dies, then elvrec will pretend that the file was named "foo". AUTHOR
Steve Kirkendall kirkenda@cs.pdx.edu ELVREC(1)
All times are GMT -4. The time now is 08:22 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy