Sponsored Content
Top Forums Shell Programming and Scripting How would I replace the 9th character of every line in a file? Post 55030 by LordJezo on Tuesday 31st of August 2004 02:14:59 PM
Old 08-31-2004
Wow.

That's a pretty clever way of doing it. I doubt I would have thought about that angle, what I was thinking was a specific character replace.

Neat.

Thanks.
LordJezo
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

to replace a new line character

sample I/p: S12J LLL H77K PPP J25O LOP I73S lOP K99O PLO Required O/p: S12J LLL H77K PPP J25O LOP I73S lOP K99O PLO how to replace a new line character with space using sed command only Cheers, Chan (2 Replies)
Discussion started by: chan
2 Replies

2. Shell Programming and Scripting

Replace certain character with a new a new line.

Hello all... please help with the following. I am parsing the following type of file... W001; W003; W025;W044; W030; W022;W024;W099;W098; Would like to make it look like this... W001 W003 W025 W044 W030 W022 W024 W099 W098 (8 Replies)
Discussion started by: djsal
8 Replies

3. Shell Programming and Scripting

replace > with new line character

<reward_data><date><datetime>071308000804</datetime></date> I want the above data to be displayed as <reward_data> <date> <datetime>071308000804</datetime> </date> How can i accomplish this. I tried the below tr "><" ">\n" < filename (4 Replies)
Discussion started by: borncrazy
4 Replies

4. Shell Programming and Scripting

how to replace character in the line

I have unix text file which has the following data aadjdfad;fa;fjjd;lakd;lkaslkd;k;k;lk;k;lk;l;lk;lkj;lj;lkj;k;lkj;lj;lkj;lkj;lkj;j sdkadk;adlf;lajf;akdjf;lkdjf;lkadjf;lkajsd;lfkj;lkj;lkj;lk;lk;lk;lk;k;lkj;k;lkm... (2 Replies)
Discussion started by: Raju Datla
2 Replies

5. Shell Programming and Scripting

read in a file character by character - replace any unknown ASCII characters with spa

Can someone help me to write a script / command to read in a file, character by character, replace any unknown ASCII characters with space. then write out the file to a new filename/ Thanks! (1 Reply)
Discussion started by: raghav525
1 Replies

6. Shell Programming and Scripting

replace character only in first line of a file

Hi, I need to replace a character in a specific position in only the first line of a file (actually many files). Change T to a P in position 103. I'm on solaris and my implementation of sed doesn't have the -r capability. Thx, Tim (8 Replies)
Discussion started by: web-guy01
8 Replies

7. AIX

removing 8th and 9th character of a FILENAME

Hi everyone, I have a file called pdf.txt which has the following list inside: 7110412_1_31122012.pdf 7286510_4_46667100.pdf 4002176_1_00018824.pdf ... I need a looping script to REMOVE the 8th and 9th character of the filenames listed, no matter what character that is. So... (4 Replies)
Discussion started by: chipahoys
4 Replies

8. Solaris

Line too long error Replace string with new line line character

I get a file which has all its content in a single row. The file contains xml data containing 3000 records, but all in a single row, making it difficult for Unix to Process the file. I decided to insert a new line character at all occurrences of a particular string in this file (say replacing... (4 Replies)
Discussion started by: ducati
4 Replies

9. UNIX for Dummies Questions & Answers

Replace 8th and 9th characters in file permanently

Good evening, I have a file and wish to replace the 8th and 9th characters on the first line only no matter what they are with 44 and the file permanantly changed. e.g. file example.txt before change: 123456789123456 hi how are you blah blah file example.txt after change: ... (4 Replies)
Discussion started by: GarciasMuffin
4 Replies

10. Shell Programming and Scripting

Replace first 3 occurances of a character in a file for each line

Hi all, I am very new to unix - ksh. I want to replace some characters in a file with some other, but only for first three occurances for each line. For eg: the first 3 occurances character ']' has to be replaced with ',' in each line. Please help. thanks Sreejith (1 Reply)
Discussion started by: rsreejithmenon
1 Replies
Cone(C)

LEAF(1) 						  Cone: COnsole Newsreader And E						   LEAF(1)

NAME
leaf - Lightweight Editor of Ascii(and more) Files SYNOPSIS
leaf [-f] [-d dictionary] [+n] [filename] USAGE
leaf is a simple console text file editor, with paragraph word-wrapping and spell checking. leaf is based on the text editor in the Cone mail reader and composer. leaf opens filename, positioning the cursor on the first line, or line #n, if specified. This is not really the best editor for program sources. leaf is meant to be used as a quick editor for writing short notes and memos. As text is typed, words will automatically flow to wrap within a typical 80-character terminal display, even on larger display (due to leaf's heritage as an editor for E-mail messages, which are traditionally formatted to fit an 80-character display). Word wrapping is "lazy": only long text lines are wrapped. Short text lines are not folded together. Individual paragraphs are separated by blank lines of text. Press CTRL-J to optimally rejustify the paragraph under the cursor. The bottom two lines on the screen list which keys to press for other functions. Flowed text The -f option enables "flowed text" formatting convention. Plain text files have no explicit means for joining multiple lines into logical paragraph. Each line of text is an individual line, and a blank line marks the end of a paragraph. In a "flowed text" formatted file, each line in a paragraph except the last one ends with a space character. This makes no visual difference, it's just a marker that this line should be merged with the next line. The last line in the paragraph does not end in a space character. The trailing space character is logically removed from each flowed line, and all flowed lines are merged into a logical paragraph that can be adjusted to any display width. It's important to note that text written in non-ideographic languages, where individual words are separated by spaces, will have two space characters at the end of every line: the space character that separates the last word on the line from the first word on the next line, and the a second space character that marks the line as a flowed line. Because the trailing space marking a flowed line is logically removed, without the second space character there will not be a logical space between the two words, and if the paragraph's width is adjusted for display the two words may get combined together. The -f option puts leaf into flowed text mode, removing spaces from each flowed line of text in an opened file. A flowed line is marked on the screen with a "<" character in the right margin (or a small "next line" character on a UTF-8 display). When saving a file leaf automatically adds a trailing space to each line that's marked as flowed. The flowed text mode stays in effect for each file opened in leaf. When opening another file, press CTRL-F to turn flowed mode on or off for the next file. This change stays in effect until it gets toggled again. Pressing CTRL-J optimally rejustifies the text in flowed text mode. leaf heuristically determines the start and the end of the paragraph, readjusts the width of the paragraph, and marks each line as flowed, except the last paragraph line. leaf uses a unicode-based algorithm for determining whether the last character line needs a space character, in addition to the flowed space marker. Note leaf is frequently used to edit plain text email message content. Because email messages assign some semantical meaning to lines of text that start with spaces or ">" characters, CTRL-J will not rejustify lines of text that begin with a ">" or a space. These lines will be considered paragraph boundaries, in addition to blank lines. Spell checking The -d option sets the name of the dictionary used for spell checking (overriding the default spell checking dictionary set by the DICTIONARY environment variable). +n sets the initial cursor position to line #n. SEE ALSO
emacs(1), vi(1) AUTHOR
Sam Varshavchik Cone(C) 04/04/2011 LEAF(1)
All times are GMT -4. The time now is 03:23 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy