12-07-2006
sed script
I have a series of folders /temp/a /temp/b /temp/c
In folders a, b, and c, I have files
a1.txt..........a20.txt
b1.txt..........b40.txt &
c1.txt..........c60.txt
Each file has the same data format :-
Line 1 AAAAA aaaa
Line 2 BBB bbbbbb
Line 3 CCCC cccccc
Etc etc
I need to write a sed script which will go through all the files and reformat the data thus :-
Line 1 AAAAA aaaa
Line 2 BBB
Line 3 X bbbbbb
Line 4 CCCC cccccc
Etc etc
So I need to insert a CR/LF in line 2 position 4,
create a new Line 3 with a constant text (X) and the value of what was to the right of the previous Line 2 (bbbbbb)
and move the remaining lines one line down.
Can anyone help please ?
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I have a lot of script files that were created by Extract in a dir that no longer exists. Now that I have to run these scripts they 'all' have to be changed. I'm looking for a way to do a 'mass' change if possible.
So far, I've dumped all of the script file names to a file and sorted them to... (5 Replies)
Discussion started by: HOlli
5 Replies
2. UNIX for Dummies Questions & Answers
I am having a shell script that connects to database half hourly and pulls out the backlog from some tables. Now that logfile is growing too big and I need to housekeep it! effectively I want to keep last 30 days data in that file and move rest to archived file.
The file contents are as below.... (14 Replies)
Discussion started by: abhi123
14 Replies
3. Shell Programming and Scripting
/\/\*/!b
:x
/\*\//!{
N
bx
}
s/\/\*.*\*\///
This scipt should remove c like commnets /**/
i know what de last line does
but i dont't know what the first lines do
Can anyone explain please (3 Replies)
Discussion started by: clauchiorean
3 Replies
4. Shell Programming and Scripting
I am trying to run a sed command within a script to edit a file.
I am trying to put the value of MYUSER into the sshd_config file.
Instead of putting the value of the variable, MYUSER, it puts in the string ${MYUSER}.
Anyone know a good solution to this?
cat ${SSHD_CONFIG} | sed... (1 Reply)
Discussion started by: Mike_the_Man
1 Replies
5. Shell Programming and Scripting
how to convert the follow sed script file into a command line ?
example:
/^\.TS/,/^\.TE/{
/^$/p
}
I have tried the below but it is not working:
# sed -n "/^\.TS/,/^\.TE/{/^$/p}" file
file:
111
.TS
222
$333 << extract this line
444
.TE
555 (2 Replies)
Discussion started by: 3Gmobile
2 Replies
6. Shell Programming and Scripting
I'm trying to write a simple script that replaces a string. The script works for uninterrupted strings, but as soon as sed encounters a space it stops reading the new string. I've tried double quotations in sed and backslashes before the $, however these don't work. Below is the script. Any help... (9 Replies)
Discussion started by: dsell002
9 Replies
7. Homework & Coursework Questions
Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted!
1. The problem statement, all variables and given/known data:
Create a sed script that will display a list of all users in the /etc/passwd file that belong to the group... (0 Replies)
Discussion started by: lakers34kb
0 Replies
8. Shell Programming and Scripting
I am beginner for Unix. I practicing unix shell script. I worked out some sed script example from internet. Everything fine.
But in real unix environment, where sed script is mainly used.?
Can anyone give some examples for the usage of sed script in real unix environment. It will be useful for... (1 Reply)
Discussion started by: gwgreen1
1 Replies
9. Shell Programming and Scripting
Hi ,
i am stuck in this simple script.
#!/bin/ksh
echo "enter the file name"
read flname
echo "enter version"
read ver
grep $flname /home/con/snsc/perl/map > flplist
dirname `cat flplist` | sed 's/\/so${vers}\//\/so${vers}_xyz\//' > dirlist
the map file is basically a list of file... (3 Replies)
Discussion started by: debu182
3 Replies
10. Shell Programming and Scripting
I am having a file as stated below :
File 1:
##########################
idnd a
integer 2;
list 1 ;
list2 ;
chip top alist( .a(1) , .b(2) , .c(3) ,
.d(1) , .e(7) , .n(80),
.d(1) , .g(7) , .n(80),
.f(1) , .e(7) , .m(80));
lis 7 nfj ;
jdjd kn;
jsjd l ; (4 Replies)
Discussion started by: kshitij
4 Replies
LEARN ABOUT DEBIAN
grcompiler
grcompiler(1) grcompiler(1)
NAME
grcompiler - Compile GDL into a TrueType Font
SYNOPSIS
grcompiler [-d] [-D] [-g] [-n number] [-v number] [-w number] [-wall] [-q] gdl-file font-file [output-file] [output-fontname]
Description
Grcompiler compiles a Graphite Description Language description of the smarts for a font along with a TrueType Font to create a graphite
font with graphite tables in it.
-d Generate XML debugger file.
-D Generate all debugger files.
-g Permit and ignore invalid glyph definitions.
-nnumber
Set name table start location.
-q Quiet mode (no messages except on error).
-vnumber
Set Silf table version number.
-wnnnn Ignore warning with the given number. This option may be repeated.
-wall Display all warnings.
Environment
grcompiler makes use of the following environment variables
GDLPP Specifies the command to execute to run the GDL preprocessor
Files
gdlerr.txt
Warnings and errors are output to this file.
dbg_classes.txt
Debug file that specifies the classes stored in the font in terms of their GDL source and containing glyph ids in hex.
dbg_cmap.txt
Debug file giving Unicode to glyph mapping of all the glyphs in the font and vice versa.
dbg_enginecode.txt
Debug file containing the action code and constraint code associated with each pass and rule in a pass.
dbg_fsm.txt
Debug file that gives the finite state machines of each pass and the rules referenced. For each pass, a mapping is given between
glyph and column number.
dbg_glyphattrs.txt
Debug file containing all the glyph attributes and their names, along with values specified for each glyph.
dbg_parsetree.txt
Debug file giving the complete parse tree of the GDL source file.
dbg_ruleprec.txt
Debug file that lists the rules in precedence order (order in which they will be tested) for each pass.
$_temp.gdl
Debug file containing the output of gdlpp
Author
Martin Hosken <mhosken@users.sourceforge.net>
$Date: 2012-05-29 11:36:50 $ grcompiler(1)