Sponsored Content
Top Forums Shell Programming and Scripting Find string in a file and append character Post 302689231 by pamu on Tuesday 21st of August 2012 02:30:10 AM
Old 08-21-2012
Assuming all are numbers except NULL..

Code:
sed 's/^[0-9]/$1/g' file

 

10 More Discussions You Might Find Interesting

1. Programming

append character to a file

Hi, fputc() will overwrite from the beginning of the target file. How would I append characters to the target file's end instead? Thanks. (3 Replies)
Discussion started by: enuenu
3 Replies

2. UNIX for Dummies Questions & Answers

Find and replace character in a string

Hi all, My problem is the following: I've a script that must list all files in a directory and write this information in a text file. I've tried to get the list through ls command and then write it using msgecho msgecho "`ls $PATH_APS_JOB_ORA`" This works good but the created string... (7 Replies)
Discussion started by: callimaco0082
7 Replies

3. Shell Programming and Scripting

append a character at end of each line of a file

Hi, i want to append a character '|' at end of each line of a file abc.txt. for example if the file abc.txt conatins: a|b|c 1|2|33 w|2|11 i want result file xyz.txt a|b|c| 1|2|33| w|2|11| I know this is simple but sumhow i am not able to reach end of line. its urgent, thanks for... (4 Replies)
Discussion started by: muaz
4 Replies

4. Shell Programming and Scripting

How do I append a ^M to the end of each 129 character string

Hello all, I have a stumper of a problem. I am trying to append a ^M or "newline" to the end of each 129 character string in a huge file in unix. Each string starts with A00. I am trying to get the file to go from... A00vswjdv1 Test Junk Junk A00vswjdv2 Test Junk Junk ... (6 Replies)
Discussion started by: Captain
6 Replies

5. HP-UX

How to remove new line character and append new line character in a file?

Hi Experts, I have data coming in 4 columns and there are new line characters \n in between the data. I need to remove the new line characters in the middle of the row and keep the \n character at the end of the line. File is comma (,) seperated. Eg: ID,Client ,SNo,Rank 37,Airtel \n... (8 Replies)
Discussion started by: sasikari
8 Replies

6. Shell Programming and Scripting

sed to find first appearance and append string

I have a file like below #GROUP A belongs to Asia GROUP A jojh hans local admin GROUP A gege fans michel jing jong #GROUP U belongs to USA GROUP U jeff goal hello world My requirement is to grep for first apperence of GROUP A which is not commented and append my name to end of file.... (12 Replies)
Discussion started by: vkk
12 Replies

7. Shell Programming and Scripting

Search for a string, then append character to end of that line only

I have 2 files that I am working with $ cat file1 server1 server3 server5 server6 server8 $ cat file2 server1;Solaris; server2; SLES; server3;Linux; server4; Solaris; server5;SLES; server6;SLES; server7;Solaris; server8;Linux; (1 Reply)
Discussion started by: snoman1
1 Replies

8. Shell Programming and Scripting

sed - Find a String and append a text end of the Line

Hi, I have a File, which have multiple rows. Like below 123456 Test1 FNAME JRW#$% PB MO Approver XXXXXX. YYYY 123457 Test2 FNAME JRW#$% PB MO Super XXXXXX. YYYY 123458 Test3 FNAME JRW#$% PB MO Approver XXXXXX. YYYY I want to search a line which contains PB MO Approver and append... (2 Replies)
Discussion started by: java2006
2 Replies

9. Shell Programming and Scripting

To append Character in file

hi, i am having a file which is comma seperated , i need to append a char in particular column for eg: infile aa,bb,c,dd,ee zz,yy,sss,ddd,ff . . i need to append for eg 4th column with a char like 'LQ' output: aa,bb,c,LQdd,ee zz,yy,sss,LQddd,ff (12 Replies)
Discussion started by: rohit_shinez
12 Replies

10. Shell Programming and Scripting

Find string in file and append new string after

Hi All, I'm trying to insert a string into a file at a specific location. I'd like to add a string after the parent::__construct(); in my file. <?php if (! defined('BASEPATH')) exit('No direct script access allowed'); class MY_Controller extends CI_Controller { function... (6 Replies)
Discussion started by: jjkilpatrick
6 Replies
putws(3C)                                                  Standard C Library Functions                                                  putws(3C)

NAME
putws - convert a string of Process Code characters to EUC characters SYNOPSIS
#include <stdio.h> #include <widec.h> int putws(wchar_t *s); DESCRIPTION
The putws() function converts the Process Code string (terminated by a (wchar_t)NULL) pointed to by s, to an Extended Unix Code (EUC) string followed by a NEWLINE character, and writes it to the standard output stream stdout. It does not write the terminal null character. RETURN VALUES
The putws() function returns the number of Process Code characters transformed and written. It returns EOF if it attempts to write to a file that has not been opened for writing. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | |MT-Level |MT-Safe | +-----------------------------+-----------------------------+ SEE ALSO
ferror(3C), fopen(3C), fread(3C), getws(3C), printf(3C), putwc(3C), attributes(5) SunOS 5.10 22 Apr 1997 putws(3C)
All times are GMT -4. The time now is 09:31 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy